User:Phantomxz/Sandbox
Jump to navigation
Jump to search
<input type="checkbox" id="hideCheckbox" style="display: none;">
<label for="hideCheckbox" style="cursor: pointer;">Hide Text</label>
This is the text to hide.
<script> document.getElementById('hideCheckbox').addEventListener('change', function() {
var textToHide = document.getElementById('textToHide'); textToHide.style.display = this.checked ? 'none' : ;
}); </script>