61,110
社区成员
发帖
与我相关
我的任务
分享
<table width="200" border="1">
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFccaa'">
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<script language="javascript">
function test(){
实现鼠标经过改变背景色的的代码.
</script>
<table width="200" border="1">
<tr onmouseout="test()">
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<script language="javascript">
function test(obj){
obj.style.backgroundColor=obj.style.backgroundColor.toLowerCase()=='#ffccaa'?"":"#ffccaa"
}
</script>
<table width="200" border="1">
<tr onmouseout="test(this)" onmouseover="test(this)">
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>