Show/Hide element using Javascript


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function showhide(e) {
  2. var el = document.getElementById(e);
  3. el.style.display = el.style.display == "block" ? "none" : "block";
  4. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.