Show and hide menu by click on button | free java script code

<button onclick="toggleText()">button</button>
<p id="Myid">Text</p>
function toggleText(){
  var x = document.getElementById("Myid");
  if ( === "none") { = "block";
  } else { = "none";

your menu div or nav id like Myid.

test this code on your web project and enjoy..

Related Posts

Leave a Reply

Your email address will not be published.