<script language=javascript>
function seleboard(n)
{
 for(i=0;i<document.getElementById("seletable").cells.length;i++)
  document.getElementById("seletable").cells[i].className="sele1";
  document.getElementById("seletable").cells[n].className="sele2";
  for(i=0;i<document.getElementById("maintable").tBodies.length;i++)
  document.getElementById("maintable").tBodies[i].style.display="none";
 document.getElementById("maintable").tBodies[n].style.display="block";
}
</script>在IE可以

解决方案 »

  1.   

    报的什么错?  另外怀疑你的seletable id重名了
      

  2.   

    cells这个属性,Firefox不能在table下用,在tr下用就有。
      

  3.   

    <table border=0 cellspacing=0 cellpadding=0 width=140 id=seletable>
    <tr height=30 align=center><td class="sele2" onclick="seleboard(0)">娱乐新闻</td></tr>
    <tr height=30 align=center><td class="sele1" onclick="seleboard(1)">游戏活动</td></tr>
    <tr height=30 align=center><td class="sele1" onclick="seleboard(2)">热门推荐</td></tr>
    <tr height=30 align=center><td class="sele1" onclick="seleboard(3)">社会百态</td></tr>
    <tr height=30 align=center><td class="sele1" onclick="seleboard(4)">热点追踪</td></tr>
    <tr height=30 align=center><td class="sele1" onclick="seleboard(5)">网络</td></tr>
    </table>
      

  4.   

    <table border=1 cellspacing=0 cellpadding=0 width=500 height=185 id=maintable><tbody style="display:block;"> 
        <tr>
         <td> <div class="show1">我你他我你他我你他我你他我你他我你他我你他我你他我你他我你他我你他<br>ddd</div></td>
        </tr></tbody> <tbody style="display:none;"> 
        <tr> 
         <td align=center width=250px height=150px> <div class="show1"><p>fffffffffffffffffffffffffffffffffffffff</p></div></td>
        </tr></tbody> 
    <tbody style="display:none;"> 
        <tr> 
         <td align=center > <div class="show1"><p>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee</p></div></td>
        </tr></tbody> 
    <tbody style="display:none;"> 
        <tr> 
         <td align=center > <div class="show1"><p>dddddddddddddddddddddddddddddddddddddddddddd</p></div></td>
        </tr></tbody> 
    <tbody style="display:none;"> 
        <tr> 
         <td align=center > <div class="show1"><p>dddddddddddddddddddddddddddddddddddddddddddd</p></div></td>
        </tr></tbody> 
    <tbody style="display:none;"> 
        <tr> 
         <td align=center > <div class="show1"><p>dddddddddddddddddddddddddddddddddddddddddddd</p></div></td>
        </tr></tbody> 
    </table>
      

  5.   

    <!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>
    demo
    </title>
    <style type="text/css">
    <!--
    body,td,th {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    }
    body {
    margin-top: 0px;
    margin-bottom: 0px;
    margin-left: 0px;
    margin-right: 0px;
    }
    a:link {
    color: #000000;
    text-decoration: underline;
    }
    a:visited {
    text-decoration: underline;
    color: #000000;
    }
    a:hover {
    text-decoration: none;
    }
    a:active {
    text-decoration: underline;
    }
    #container{
        margin-left:auto;
    margin-right:auto;
    width:1066px;;
    }
    #left{
        margin-top:20px;
        margin-left:40px;
        width:710px;
    float:left;
    clear:right; 
    }
    #up{
        margin:0px;
    width:684px;
    height:264px;
    }
    .sec1 {
      background:transparent  #FFFFFF no-repeat 0px 0em;
      cursor: pointer;
      color: #000000;
      font-weight: bold;
      height:40px;
      font-size:16px;
      }
    .sec2 {
      background:transparent #66CCFF no-repeat 0px 0em;
      cursor: pointer;
      color: #FF0000;
      font-weight: bold;
      height:40px;
      font-size:16px;
      }
    .main_tab {
      background-color:#FFFF33;
      position:inherit;
    }
    .STYLE3 {font-size: 10px; color: #666666; }-->
    </style>
    <script language=javascript>
    function secBoard(n)
    {
    for(i=0;i<document.getElementById('secTable').rows[0].cells.length;i++){
    document.getElementById('secTable').rows[0].cells[i].className="sec2";
    document.getElementById('secTable').rows[0].cells[n].className="sec1";
    }
    for(i=0;i<document.getElementById('mainTable').tBodies.length;i++){
    document.getElementById('mainTable').tBodies[i].style.display="none";
    }
    document.getElementById('mainTable').tBodies[n].style.display="block";
    }
    </script>
    </head>
    <body>
    <div id="container">
         <div id="left">
                   <div id="up">
                   <table width="516px" height="40px;" border=0 cellpadding=0 cellspacing=0 id=secTable>
               <tr align=center> 
                          <td width="258px" valign="middle"  class=sec1 onclick="secBoard(0)">Find a business</td>
                          <td width="258px" valign="middle" class=sec2 onclick="secBoard(1)">Add your buisiness</td>
                </tr>
               </table> 
              <table width="685px" height="224px"  border="0"  cellpadding="o" cellspacing="0" class="main_tab" id="mainTable">
                <form action="" method="post" name="find_business" id="find_business">
                  <tbody style="display:block;">
                   <tr><td>1111111111111111111111</td></tr>
                  </tbody>
                </form>
                <tbody style="display:none;">
                  <tr>
                    <td align="center" valign="top"><br />
                      2222222222 </td>
                  </tr>
                </tbody>
              </table>
           </div>
          </div>
    </div>
    </body>
    </html>