<!DOCTYPE html>
<html>
<head>
<title>变色表格示例</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<script type="text/javascript" language="javascript">
function changecolor(row){
document.getElementById(row).style.backgroundColor="blue";}
function resetcolor(rowq){
document.getElementById(rowq).style.backgroundColor="red";}
</script>
</head>
<body>
<table width="200" border="1" cellspacing="1" cellpadding="1">
<tr>
<th>学校</th><th>专业</th><th>人数</th>
</tr>
<tr align="center" id="row1" onmouseover="changecolor('row1')" onmouseout="resetcolor('row1')">
<td>北大</td><td>法律</td><td>2000</td></tr>
</tr>
<tr align="center" id="row2" onmouseover="changecolor('row2')" onmouseout="resetcolor('row2')">
<td>清华</td><td>计算机</td><td>5000</td></tr>
</tr>
<tr align="center" id="row3" onmouseover="changecolor('row3')" onmouseout="resetcolor('row3')">
<td>人大</td><td>经济</td><td>6000</td></tr>
</table>
</body>
</html>
变色表格示例
最新推荐文章于 2018-10-30 23:31:04 发布