this.style.display=none
this.style.display=block
切换就行了

解决方案 »

  1.   

    this.style.display=none
    this.style.display=block
    你这个说的应该是点击的本身隐藏
    我要的是点击后,下面的表格隐藏显示。,而且别的表格不显示
      

  2.   


    给表格设置上id,或name属性,通过
    document.getElementById或document.getElementsByName[0].style.display=none|blocks
    就可以实现表格的隐藏显示了
      

  3.   

    js你已经写出来了  你只需要把html改下就好了<h3>标题一
      <div class="div1">标题一简单描述</div>
    </h3>
    <table id="tab_box" class="tab">
      <tr>
        <td>标题一内容</td>
      </tr>
    </table>
      

  4.   


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <title>无标题文档</title>
            <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
            <script type="text/javascript">
    $(document).ready(function(){
      $("#tab_box2").hide();
      $("#tab_box3").hide();
      $("h3").click(function() {
     $(this).parent().siblings().children(".tab").hide(); 
    $(this).next().next().show();
       })
    })
            </script>
        </head>
        
        <body>
         <div>
         <h3>标题一</h3>
            <div class="div1">标题一简单描述</div>
            <table id="tab_box1" class="tab" border="1">
               <tr>
                  <td>标题一内容</td>
               </tr>
            </table>
            </div>
            <div>
            <h3>标题二</h3>
            <div class="div1">标题二简单描述</div>
            <table id="tab_box2" class="tab" border="1">
               <tr>
                  <td>标题二内容</td>
               </tr>
            </table>
            </div>
            <div>
            <h3>标题三</h3>
            <div class="div1">标题三简单描述</div>
            <table id="tab_box3" class="tab" border="1">
               <tr>
                  <td>标题三内容</td>
               </tr>
            </table>
            </div>
        </body>
    </html>html结构改了下 在外面加了层div