$(this).parents('table:first > tbody > tr')
And
$(this).parents('table:first').children('tbody').children('tr')
The difference is that the first selector is entirely within the parents
call, whereas the second one isn't.
Therefore, the first one looks for all parents of this
which match table:first > tbody > tr
. (In other words, a tr
containing this
that is in the first table
)
The second one will find the parent of this
which matches table:first
, then find all of the tr
s directly within tbody
s of that parent. (In other words, all of the tr
s directly inside the parent table)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With