jQuery select only tr/td in main table, not nested tables.

前端 未结 4 1855
感情败类
感情败类 2021-02-07 08:23

I currently have a table with a nested table in it:

   

        
      
      
      
4条回答
  •  半阙折子戏
    2021-02-07 09:00

    You use the > selector to target only the direct descendant of an element. You have to target the implicit tbody element inside the table also:

    $('#report>tbody>tr.odd')
    

提交回复
热议问题