变色表格示例

<!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>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值