We Recommend

Pro JavaScript Techniques Pro JavaScript Techniques
Pro JavaScript Techniques is the ultimate JavaScript book for the modern web developer. It provides everything you need to know about modern JavaScript, and shows what JavaScript can do for your web sites. This book doesn't waste any time looking at things you already know, like basic syntax and structures.


Posted By

assbach on 12/10/06


Tagged

show css toggle visibility hide hidden


Versions (?)


Who likes this?

3 people have marked this snippet as a favorite

xhtmled
basicmagic
tmarkiewicz


toggle visibility (show/hide)


Published in: JavaScript 


toggle a div via JS/CSS style

  1. function toggle(obj) {
  2. var el = document.getElementById(obj);
  3. el.style.display = (el.style.display != 'none' ? 'none' : '' );
  4. }

Report this snippet 

You need to login to post a comment.