jQuery Select first and second td

后端 未结 7 1366
南旧
南旧 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:34

    You can do in this way also

    var prop = $('.someProperty').closest('tr');
    

    If the number of tr is in array

    $.each(prop , function() {
      var gotTD = $(this).find('td:eq(1)');                 
    });
    

提交回复
热议问题