Jquery loop through all the rows in a table without first row

前端 未结 4 1915
孤独总比滥情好
孤独总比滥情好 2021-02-11 03:19

I need to loop through all rows for a particular table, and I have done it as below. At one point, I need to remove the matching table row. I couldn\'t figure out how to skip t

相关标签:
4条回答
  • 2021-02-11 03:45
    $('#tbl_dynamic_call_dates > tbody  > tr').not(":first").  [....]
    

    to get everything BUT the first


    $('#tbl_dynamic_call_dates > tbody  > tr:first'). [...]
    

    or

    $('#tbl_dynamic_call_dates > tbody  > tr').first(). [...]
    

    to only get the first

    0 讨论(0)
  • 2021-02-11 04:01

    Change your selector to this...

    $('#tbl_dynamic_call_dates > tbody  > tr:not(:first)')
    
    0 讨论(0)
  • 2021-02-11 04:04

    You can do this using the :gt() Selector like:

    $('#tbl_dynamic_call_dates > tbody  > tr:gt(0)').each(function() {...});
    
    0 讨论(0)
  • 2021-02-11 04:09
    $('#tbl_dynamic_call_dates > tbody  > tr:gt(0)').each(/*...*/);
    

    Or:

    $('#tbl_dynamic_call_dates > tbody  > tr').first().siblings().each(/*...*/);
    
    0 讨论(0)
提交回复
热议问题