javascript display div code example
Example 1: how to hide div in html
document.getElementById('elementName').hide();
Example 2: javascript show div
' Toggles hide / show
function myFunction(div_id) {
var x = document.getElementById(div_id);
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
Example 3: toggle element javascript
document.querySelector("#test").hidden = true;
document.querySelector("#test").hidden = false;