<body>
<script>
currentRow = -1;
oldRow = -1;
function aa(curRow){ if(oldRow >= 1)t1.rows[oldRow -1].style.backgroundColor ="white";
t1.rows[curRow -1].style.backgroundColor ="black";

currentRow = curRow;
oldRow = currentRow;

}
</script>
<table border=1 id=t1>
<tr row=1 onclick="aa(this.row)">
<td>a</td>
<td>b</td>
</tr>
<tr row=2 onclick="aa(this.row)">
<td>c</td>
<td>d</td>
</tr>
</table>
</body>

解决方案 »

  1.   

    <table>
    <tr><td onMouseOver=this.style.backgroundColor='#C6E3FF' onMouseOut=this.style.backgroundColor='#FFFFFF'>sdgasdgasdgasdgasdfgasgasdhgasdgasdgdg</td></tr>
    <tr><td onMouseOver=this.style.backgroundColor='#C6E3FF' onMouseOut=this.style.backgroundColor='#FFFFFF'>sdgasdgasdgasdgasdfgasgasdhgasdgasdgdg</td></tr>
    <tr><td onMouseOver=this.style.backgroundColor='#C6E3FF' onMouseOut=this.style.backgroundColor='#FFFFFF'>sdgasdgasdgasdgasdfgasgasdhgasdgasdgdg</td></tr>
    </table>这个怎么样咯
      

  2.   

    谢谢  kingdomzhf(旭日东升),您的解答和跟我想要的一样。
    也谢谢  52juanjuan(Fibona) ,不过照您所作的,只是改变鼠标指向的行背景色.我需要点击时候将行的值赋给其他值..结贴