Posted By

iroybot on 07/11/10


Tagged

javascript js toggle


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

iroybot
nerdfiles
mchadwick


toggle


 / Published in: JavaScript
 

  1. function toggle(obj) {
  2. var el = document.getElementById(obj);
  3. if ( el.style.display != 'none' ) {
  4. el.style.display = 'none';
  5. }
  6. else {
  7. el.style.display = '';
  8. }
  9. }

Report this snippet  

You need to login to post a comment.