Object.style.display = "";  //--ShowObject.style.display = "none";   //--Hide

解决方案 »

  1.   

    <html>
    <head>
    <title>调试</title>
    <script language=javascript>
    function HideObj(Obj)
    {
      Obj.style.display = "none";
    }
    function ShowObj(Obj)
    {
     Obj.style.display = "";
    }
    </script>
    </head>
    <body>
    <table id="Tab">
      <tr>
        <td>这是表格内容</td>
      </tr>
    </table>
    <input type=button onclick="HideObj(window.document.all.Tab);" value="隐藏表格">
    <input type=button onclick="ShowObj(window.document.all.Tab);" value="显示表格">
    </body>
    </html>
      

  2.   

    改了一下:<html>
    <head>
    <title>调试</title>
    <script language=javascript>
    function ShowHideObj(Obj)
    {
      Obj.style.display = Obj.style.display=="none" ? "" : "none";
    }
    </script>
    </head>
    <body><input type=button onclick="ShowHideObj(Tab);" value="显示/隐藏"><table id="Tab">
      <tr><td>这是表格内容</td></tr>
    </table></body>
    </html>