<html>
<body>
<h1>Controlled checkbox</h1>
<input type="checkbox" id="controlled" aria-label="Controlled">
<div id="out"></div>
<script>
const box = document.getElementById("controlled");
const out = document.getElementById("out");
const show = () => {
out.textContent = "";
const heading = document.createElement("h2");
heading.textContent = "Reports " + (box.checked ? "on" : "off");
out.appendChild(heading);
};
box.checked = false;
show();
box.addEventListener("change", show);
</script>
</body>
</html>