我想获取表中倒数第二个 TR。
$("#TableID tr:last")
获取最后一个,有什么方法可以在该之前获取 TR 吗?
最佳答案
当为 eq 指定负索引时,它从末尾开始倒数。
.eq( -index )
-index An integer indicating the position of the element, counting backwards from the last element in the set.
$('#TableID tr').eq(-2)
关于jquery - 选择最后一个 tr 旁边的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3560233/