ps-blitz-script 0.4.6

JavaScript execution for Blitz using the Boa engine
Documentation
<!--
  What a listener on a checkbox sees when the control is pressed.
  Outcomes are headings, because that is what the harness can name and assert.
-->
<html>
  <body>
    <h1>Checkbox activation</h1>

    <label id="bare-label">
      <input type="checkbox" id="bare" aria-label="Bare checkbox">
      <span>Bare checkbox</span>
    </label>
    <div id="bare-out"></div>

    <script>
      const bare = document.getElementById("bare");
      const bareOut = document.getElementById("bare-out");
      const seen = [];
      for (const name of ["click", "input", "change"]) {
        bare.addEventListener(name, () => {
          seen.push(name + ":" + bare.checked);
          bareOut.textContent = "";
          const heading = document.createElement("h2");
          heading.textContent = "Bare saw " + seen.join(",");
          bareOut.appendChild(heading);
        });
      }
    </script>
  </body>
</html>