Hide and show element using plain javascript Please check the below code snippet:- //HTML Click Me This is my DIV element. // JS function ToggleElement() { var x = document.getElementById("myDIV"); if (x.style.display === "none") { x.style.display = "block"; } else