jquery selecting all elements except the last per group

后端 未结 2 913
被撕碎了的回忆
被撕碎了的回忆 2020-12-30 19:30

I have a table that looks like:

提交回复
热议问题
onetwothreelast<
2条回答
  •  情书的邮戳
    2020-12-30 20:22

    Use this:

    $('tr td:not(:last-child)').css('background-color', 'red');
    

    It's saying each

that's not the last in that particular