<html>
<body>
<p>Display some text when the checkbox is checked:</p>
Checkbox: <input type="checkbox" id="myCheck" onclick="myFunction()">
<p id="text" style="display:none">Checkbox is CHECKED!</p>
<script>
function myFunction() {
var checkBox = document.getElementById("myCheck");
var text = document.getElementById("text");
if (checkBox.checked == true){
text.style.display = "block";
} else {
text.style.display = "none";
}
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/howto/tryit.asp?filename=tryhow_js_display_checkbox_text by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 02:38:49 GMT -->
</html>