怎么样使用javascript设置嵌套表格的显示和隐藏?
怎么样使用javascript设置嵌套表格的显示和隐藏?
<script language="javascript">function setdiv(divname) {
var obj = document.getElementById(divname);
if (obj.style.display == "none") {
obj.style.display = "table-row";
} else {
obj.style.display = "none";
}
}
</script>
<table bgcolor="#999999" border="1" width="240">
<tr>
<td width="80">1111111111111111111111</td>
<td width="80">2222222222222222222222</td>
<td width="80">3333333333333333333333</td>
</tr>
<div>
<tr id="t" style="display:none">
<td width="80">aaaaaaaaaaaaaaaaaaaaaa</td>
<td width="80">bbbbbbbbbbbbbbbbbbbbbb</td>
<td width="80">cccccccccccccccccccccc</td>
</tr>
</div>
<tr>
<td width="80">4444444444444444444444</td>
<td width="80">5555555555555555555555</td>
<td width="80">6666666666666666666666</td>
</tr>
</table>