User:Phantomxz/Sandbox

From Ylvapedia
Revision as of 18:30, 1 June 2024 by Phantomxz (talk | contribs)
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>