I currently have a table with a nested table in it:
相关标签:
-
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')
-
2021-02-07 09:08
You want
$("#report>tr")
The > means direct descendant (child) rather than any descendant.
-
2021-02-07 09:12
with this solution it does not matter whether you have a tbody tag in between:
$('table').find('tr:first').parent().children()
-
2021-02-07 09:19
Use the child selector > to only select those tr elements that are a child of the report table’s tbody , for example:
$("#report > tbody > tr.odd")
|