toggle visibility (show/hide)


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

toggle a div via JS/CSS style


Copy this code and paste it in your HTML
  1. function toggle(obj) {
  2. var el = document.getElementById(obj);
  3. el.style.display = (el.style.display != 'none' ? 'none' : '' );
  4. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.