<table  >
<tr   onmousemove  ="this.style.backgroundColor='yellow'" onmouseout ="this.style.backgroundColor='white'">
<td>变色</td>
</tr>
 <tr   onmousemove  ="this.style.backgroundColor='yellow'" onmouseout ="this.style.backgroundColor='white'">
<td>变色</td>
</tr><tr   onmousemove  ="this.style.backgroundColor='yellow'" onmouseout ="this.style.backgroundColor='white'">
<td>变色</td>
</tr><tr   onmousemove  ="this.style.backgroundColor='yellow'" onmouseout ="this.style.backgroundColor='white'">
<td>变色</td>
</tr></table>

解决方案 »

  1.   

    <script language="javascript">
     function change()
     {
      this.style.backgroundColor='yellow';
      var len=document.Form1.tags("tr");
          for (var i=0;i<len.length;i++)
        {
        if(len[i].style.backgroundColor=='yellow'&&len[i].id!=this.id)
     {
    len[i].style.backgroundColor='white';
     }
       
        }
     }
       
     </script>
    <table  >
    <tr id=tr1  onclick  ="change()"  >
    <td>变色</td></tr>
    <tr id=tr2  onclick  ="change()"  >
    <td>变色</td></tr>
    <tr id=tr3  onclick  ="change()"  >
    <td>变色</td></tr>
    <tr id=tr4  onclick  ="change()"  >
    <td>变色</td></tr>
    <tr id=tr5  onclick  ="change()"  >
    <td>变色</td></tr>
    </table>
      

  2.   

    up主要靠table 的id 的css属性来控制