就是全选和全不选的两个button,点全选会把下面两行的背景变灰,而点全不选则变白

解决方案 »

  1.   

    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head><body bgcolor="#FFFFFF" text="#000000">
    <script laguage="Javascript">function Sel(){
    for(i=1;i<colorTable.rows.length;i++)
    colorTable.rows[i].bgColor="#FFFFFF";
    }
    function noSel(){
    for(i=1;i<colorTable.rows.length;i++)
    colorTable.rows[i].bgColor="#E4E4E4";
    }
    </script>
    <table width="96%" align="right" class="IPNET_TABLE" border="1" id="colorTable">
      <tr bgcolor="ccdffd"> 
        <td width="30%"> 
          <div align="right">电路名称&nbsp;&nbsp;&nbsp;&nbsp; 
                  <input type="button" value="全选" class="boutton_text_s" onClick="noSel()">
                  <input type="button" value="全不选" class="boutton_text_s" onClick="Sel()">&nbsp;&nbsp;
                </div>
        </td>
    <td width="35%"> 
          <div align="center">源接口IP地址</div>
        </td>
        <td width="35%"> 
          <div align="center">目的接口IP地址</div>
        </td>
      </tr>
    <tr onClick="tdBg()" style="CURSOR: hand"> 
        <td>杭州骨干-温州骨干POS电路</td>
        <td>211.91.42.2</td>
        <td>POS4/0</td>
      </tr>
      <tbody> 
    <tr onClick="tdBg()" style="CURSOR: hand"> 
        <td>杭州骨干-温州骨干POS电路</td>
        <td>211.91.42.2</td>
        <td>POS4/0</td>
      </tr>
    </tbody> 
    </table>
    </body>
    </html>