<html>
<head runat="server">
<title></title>
<script type="text/javascript">
function ss() {
//document.getElementById("rr").bgColor= "#FF0080";
rr.bgColor = "#FF0080";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table id="modifytable">
<tr id="rr">
<td>A</td>
<td>B</td>
<td>C</td>
</tr>
<tr>
<td>A</td>
<td>B</td>
<td>C</td>
</tr>
</table>
<input id="Button1" type="button" value="button" onclick="ss()" />
</div>
</form>
</body>
</html>
--------------------------------------------------
为什么(rr是id) document.getElementById("rr").bgColor= "#FF0080" 与 rr.bgColor = "#FF0080"执行的效果一样的?
<head runat="server">
<title></title>
<script type="text/javascript">
function ss() {
//document.getElementById("rr").bgColor= "#FF0080";
rr.bgColor = "#FF0080";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table id="modifytable">
<tr id="rr">
<td>A</td>
<td>B</td>
<td>C</td>
</tr>
<tr>
<td>A</td>
<td>B</td>
<td>C</td>
</tr>
</table>
<input id="Button1" type="button" value="button" onclick="ss()" />
</div>
</form>
</body>
</html>
--------------------------------------------------
为什么(rr是id) document.getElementById("rr").bgColor= "#FF0080" 与 rr.bgColor = "#FF0080"执行的效果一样的?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货