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

前端 未结 4 2032
迷失自我
迷失自我 2021-02-11 03:32

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:48

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

    $('#tbl_dynamic_call_dates > tbody  > tr:gt(0)').each(function() {...});
    
    0 讨论(0)
  • 2021-02-11 03:49
    $('#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 03:56

    Change your selector to this...

    $('#tbl_dynamic_call_dates > tbody  > tr:not(:first)')
    
    0 讨论(0)
  • 2021-02-11 04:01
    $('#tbl_dynamic_call_dates > tbody  > tr:gt(0)').each(/*...*/);
    

    Or:

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