如何使用jQuery从表中的最后一个tr中选择前一个td?

时间:2013-05-28 14:29:24

标签: javascript jquery css html-table

我想从表中的最后一个tr中选择并更改之前的tds,但我不能。如何使用jQuery做到这一点?

enter image description here

选择prev tr with;

$(".tbl tr:last-child").prev()

但我怎样才能选择prev tr的孩子?

http://jsfiddle.net/dba7v/1/

1 个答案:

答案 0 :(得分:5)

$(".tbl tr:last-child").prev().children()

或简单$(".tbl tr:nth-last-child(2) > td")