<!-------------------------------- 实现动态表格------------------------->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
function changecolor(obj, color){ //修改当前行的元素
//alert(color); //检测事件触发
obj.bgColor = color; //Color 字母大写!!
}
</script>
<title>Insert title here</title>
</head>
<body>
<!-------------------------------- 实现动态表格------------------------->
<table border="1" cellpadding="5" cellspacing="0" bgColor="red">
<tr οnmοusemοve="changecolor(this,'white')" οnmοuseοut="changecolor(this,'red')">
<td>部门编号</td>
<td>部门名称</td>
<td>部门位置</td>
</tr>
<tr οnmοusemοve="changecolor(this,'white')" οnmοuseοut="changecolor(this,'red')">
<td>10</td>
<td>财务部</td>
<td>上海</td>
</tr>
<tr οnmοusemοve="changecolor(this,'white')" οnmοuseοut="changecolor(this,'red')">
<td>20</td>
<td>技术部</td>
<td>北京</td>
</tr>
</table>
</body>
</html>