鼠标经过区块会变色的实验

来源:互联网 发布:浪腾软件招聘 编辑:程序博客网 时间:2024/04/29 02:19
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Untitled Document</title>
</head>

<body>
<table width="761" height="119" border="1">
  
<tr onmouseover='this.style.backgroundColor="#f6f6f6"' onMouseOut='this.style.backgroundColor=""'>
    
<td>&nbsp;</td>
    
<td>&nbsp;</td>
    
<td>&nbsp;</td>
  
</tr>
  
<tr onMouseOver='this.style.backgroundColor="#f6f6f6"' onMouseOut="this.style.backgroundColor=''">
    
<td>&nbsp;</td>
    
<td>&nbsp;</td>
    
<td>&nbsp;</td>
  
</tr>
  
<tr>
    
<td onMouseOver="this.style.backgroundColor='#f6f6f6'" onMouseOut="this.style.backgroundColor=''">&nbsp;</td>
    
<td onMouseOver="this.style.backgroundColor='#f6f6f6'" onMouseOut="this.style.backgroundColor=''">&nbsp;</td>
    
<td onMouseOver="this.style.backgroundColor='#f6f6f6'" onMouseOut="this.style.backgroundColor=''">&nbsp;</td>
  
</tr>
</table>
</body>
</html>
 下面还有一种方法
  <tr onMouseOver='this.bgColor="#f6f6f6"' onMouseOut="this.bgColor=''">
    
<td>&nbsp;</td>
    
<td>&nbsp;</td>
    
<td>&nbsp;</td>
  
</tr>