网页javascript问题,如何把鼠标放到一个表格,表格内的文字变成白色

来源:百度知道 编辑:UC知道 时间:2024/07/12 06:44:35
把鼠标移动到表格上,表格内的文字自动变色,鼠标移走,颜色恢复。

<html>
<head>
<title></title>
<script>
function changeColor(ele){
ele.style.color="#0066cc";
}
function resetColor(ele){
ele.style.color="";
}
</script>
</head>
<body>
<table style="font-size:12px;border:1px solid #ccc;width:200px;height:100px;" onmousemove="changeColor(this)" onmouseout="resetColor(this)">
<tr><td>test</td></tr>
</table>
</body>
</html>