0
$("#experiences tr").gt(0).dblclick(function() {
$(this).remove();
});
我用上面的代碼來排除第一行,如何使用jQuery選擇除了某個表外的行?
,但事實證明是錯誤的。
現在雙擊所有行都沒有響應。
$("#experiences tr").gt(0).dblclick(function() {
$(this).remove();
});
我用上面的代碼來排除第一行,如何使用jQuery選擇除了某個表外的行?
,但事實證明是錯誤的。
現在雙擊所有行都沒有響應。
$("#experiences tr:gt(0)").dblclick(function() {
$(this).remove();
});
或
$("#experiences tr:not(:first)").dblclick(function() {
$(this).remove();
});
只排除第二行:
$("#experiences tr:not(:eq(1))").dblclick(function() {
$(this).remove();
});
最好使用一個類的行。
爲要連線雙擊事件的行添加一個類,它會更容易。
如果我想排除第二行,該怎麼辦? – omg 2009-08-27 07:13:39
只是第二排? – 2009-08-27 07:14:09
爲什麼不存在「不相等」的ne? – omg 2009-08-27 07:15:49