Toggle Show/Hide


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



Copy this code and paste it in your HTML
  1. function toggleShowHide(id) {
  2. var e = document.getElementById(id);
  3. if (e.style.display === "block") {
  4. e.style.display = "none";
  5. } else {
  6. e.style.display = "block";
  7. }
  8. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.