Crossbrowser JS...
        Posted  
        
            by s4v10r
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by s4v10r
        
        
        
        Published on 2010-03-09T11:11:57Z
        Indexed on 
            2010/03/09
            11:21 UTC
        
        
        Read the original article
        Hit count: 535
        
cross-browser
|JavaScript
Hi there all :)
Made this nice little loop for hiding and showing div's, works as a charm in firefox and opera, but IE, safari and chrome say's no.... So my question is; why?
function theme(nr){
  document.getElementById(nr).style.display = "block";
  for (i = 0;i <= 28; i++) {
   if (i != nr) {
    document.getElementById(i).style.display = "none";
   }    
  }
 }
Thanx:)
© Stack Overflow or respective owner