<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"; } }