HTML JS
(real quick examples)
GET ALL FORM ELEMENTS IN DIV var all = document.querySelectorAll("#TARGET input, #TARGET textarea, #TARGET select, #TARGET button"); DISABLE ALL for (let el of all) { el.disabled = true; }
GET TARGET DIV var div = document.getElementById("TARGET"); HIDE IT div.style.display = "none";
<div id="container"> <h1>TITLE</h1> <p>TEXT</p> <div id="overlay"></div> </div>
#container { position: relative; } #overlay { display: none; z-index: 99; width: 100%; height: 100%; position: absolute; top: 0; left: 0; background: rgba(0, 0, 0, 0.5); }
THIS WILL "DISABLE ALL CLICKS" #TARGET { pointer-events: none; }
NO TEXT HIGHLIGHT ALLOWED .nohighlight *::selection { background: none; } .nohighlight { user-select: none; }