我想隐藏div 2
和div 3
。 但它不工作。 它只有在我将div从表格中拉出后才能使用。任何人都可以向我解释为什么?隐藏表格中的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>
试过但它不起作用 –
@JonathanChan看我的upd吃 –