<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style>
#ta{
background:#eeefff;
border:1px groove blue;
}
</style>

</head>

<body>
<table id="ta" >
<tr >
<th onclick="style1(this);">html</th>
<th onclick="style1(this);">css</th>
</tr>
<tr >
<td onclick="style1(this);">xue</td>
<td onclick="style1(this);">xiaoyu</td>
</tr>

</table>
<script language="javascript" type="text/javascript" defer="defer">
function style1(el){
var me3="#"+Math.floor(Math.random()*256).toString(16)+Math.floor(Math.random()*256).toString(16)+Math.floor(Math.random()*256).toString(16);

el.style.backgroundColor=me3;
el.style.border="2px solid";
el.style.borderColor=me3;
el.style.padding="10px 10px 10px 10px";
}
</script>

posted on 2007-02-12 15:00  xf雪儿  阅读(552)  评论(0编辑  收藏  举报