html hide till button click

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

<div id="myDIV">
  
This is my DIV element.
</div> function myFunction() {
  var x = document.getElementById("myDIV");

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

Also in JavaScript: