我试图隐藏div 2
和div 3
。但它不起作用。它只有在我将 div 从表中拉出后才有效。谁能向我解释为什么?
脚本
<script>
$(document).ready(function(){
$("#2").hide();
$("#3").hide();
});
</script>
HTML
<div align="center">
<table width="10%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th scope="row"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<div id = "1">
<th><input type = "button" value = "1.1" ></th>
<th><input type = "button" value = "1.2" ></th>
<th><input type = "button" value = "1.3" ></th>
</div>
<div id = "2">
<th><input type = "button" value = "2.1" ></th>
<th><input type = "button" value = "2.2" ></th>
<th><input type = "text" value = "2.3" ></th>
</div>
<div id = "3">
<th><input type = "button" value = "3.1" ></th>
<th><input type = "button" value = "3.2" ></th>
</div>
</tr>
</table></th>
</tr>
</table>
</div>