我想隱藏一些使用jQuery的ID。 我的HTML代碼
<table>
<tr id="incomplete"></tr>
<tr id="complete"></tr>
<tr id="incomplete"></tr>
<tr id="incomplete"></tr>
<tr id="complete"></tr>
</table>
和jQuery代碼
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("#button-entryc").click(function() {
jQuery("#incomplete").css("display","none");
jQuery("#complete").css("display","table-row");
});
jQuery("#button-entryi").click(function() {
jQuery("#incomplete").css("display","table-row");
jQuery("#complete").css("display","none");
});
});
</script>
但它適用於只在ID(它發現的第一個標識)爲什麼?
是的,它應該如果它應用到多張元素是一個類 – Liam 2012-03-15 13:51:25
OMG我是新的,所以不知道這一點,謝謝 – 2012-03-15 13:51:52