87,909
社区成员
发帖
与我相关
我的任务
分享
用 backgroundColor
<table id = "xyz123" height="30" width="150" border="2" style="background-color:Red;" >
<!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=ISO-8859-1">
<title></title>
<script language="JavaScript" type="text/JavaScript">
function handle()
{
alert(document.getElementById("xyz123").width);
alert(document.getElementById("xyz123").getAttribute("bgcolor"));
// 这句输出一个undifined,为什么 不能访问和修改其中的bgcolor。。。。。。。。崩溃
}
</script>
</head>
<body id = "uuu" bgcolor = "lightblue" onload="handle();">
<table id = "xyz123" height="30" width="150" bgcolor="red" border="2">
<tr bordercolor="yellow" height="30" onmouseover="handle();" >
<th rowspan="2" >学生基本信息查询</th>
</tr>
</table>
</body>
</html>