jQuery Select first and second td

后端 未结 7 1363
南旧
南旧 2020-12-05 04:21

How can I add a class to the first and second td in each tr?

THIS ONE
相关标签:
7条回答
  • 2020-12-05 04:53
    $(".location table tbody tr td:first-child").addClass("black");
    $(".location table tbody tr td:nth-child(2)").addClass("black");
    

    http://jsfiddle.net/68wbx/1/

    0 讨论(0)
提交回复
热议问题