Peabody
0
Q:

html hide till button click


<button onclick="myFunction()">Click Me</button>

<div id="myDIV">
  
This is my DIV element.
</div> 
1

function myFunction() {
  var x = document.getElementById("myDIV");

    if (x.style.display 
=== "none") {
    x.style.display = "block";
  } else {
    x.style.display = 
  "none";
  }
} 
9

New to Communities?

Join the community