如何使用 jQuery 选择器选择表的所有行最后 3 行? 提前致谢。
最佳答案
作为@Lye Fisk指出,您需要起始索引来获取除最后 3 行以外的所有行
$('#yourtable tr').slice(0, -3) //should return all rows except last 3
您可以使用 jQuery slice用负数弹出结束元素。
$('#yourtable tr').slice(-3) //should return the last 3
关于javascript - jquery 选择器 - 除了最后 3 条记录之外的表的所有行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32315003/