jQuery Select first and second td

后端 未结 7 1364
南旧
南旧 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:32

    jquery provides one more function: eq

    Select first tr

    $(".bootgrid-table tr").eq(0).addClass("black");

    Select second tr

    $(".bootgrid-table tr").eq(1).addClass("black");

提交回复
热议问题