<html>
<head>
</head>
<body>
<table  >
<tr  >
<td onclick="this.backgroundColor='#0069AD'" onMouseout="this.backgroundColor=''">甲1111111111 </TD> 
<td  >乙2222222222 </TD> 
<td  >丙3333333333 </TD> 
<td  >丁4444444444 </TD> </tr>
</table>
</body>
</html>
其它都一样。

解决方案 »

  1.   

    代码如下:
    <html>
    <head>
    </head>
    <body>
    <script language="javascript">
    function chgColor(obj)
    {
       var theTable = document.getElementById("myTable");
       var theTds = theTable.cells;
       for(var i=0;i<theTds.length;i++)
       {
         if(theTds[i]!=obj)
          theTds[i].bgColor="white";
         else
          theTds[i].bgColor="#0069AD"; 
       }
    }
    </script>
    <table id="myTable">
    <tr>
    <td onclick="chgColor(this);" >甲1111111111 </TD> 
    <td onclick="chgColor(this);" >乙2222222222 </TD> 
    <td onclick="chgColor(this);" >丙3333333333 </TD> 
    <td onclick="chgColor(this);" >丁4444444444 </TD> 
    </tr>
    </table>
    </body>
    </html>