<table id="tab1" style="display:none"> 
不带分号试试,带分号好像是css文件里的写法。

解决方案 »

  1.   

    大哥,你看看你的JAVASCRIPT
                 if(obj1.style.display=="none"){ 
                                  obj1.style.display=""; 
                                  obj2.style.diaplay="none"; 
                  }else{ 
                                  obj1.style.display="none"; 
                                    obj2.style.diaplay=""; 
              } 
     obj2.style.diaplay="none"; ??????????
     obj2.style.display="none"; 
    JT,JF
      

  2.   

    <table> 
        <tr> 
            <table   id="tab1"   style="display:none;"> 
              ´úÂë 1
              </table> 
        </tr> 
        <tr>     
            <table   id="tab2">   
            ´úÂë 2
            </table> 
        </tr> 
        <input   type="button"   onclick="display()"     value="ÏÔʾ¸ü¶à"/> 
    </table> <script     language=javascript> 
    function   display(){ 
                var   obj1=document.getElementById("tab1"); 
                var   obj2=document.getElementById("tab2"); 
                          
                  if(obj1.style.display=="none"){ 
                                  obj1.style.display=""; 
                                  obj2.style.display="none"; 
                  }else{ 
                                  obj1.style.display="none"; 
                                    obj2.style.display=""; 
              } 
        } 
    </script>