Reputation: 9037
I'm trying to select the first child of a first sibling in jquery but having some trouble getting it right:
<tr class="foo"></tr>
<tr>
<td>
I have a handler attached to tr.foo and I want to do something to the td, but I'm not getting the selector right.
Upvotes: 1
Views: 6664
Reputation: 35477
The selector tr + tr td
selects the td that has a tr parent that is preceeded by another tr.
Upvotes: 1
Reputation: 1754
Try this:
$("tr.foo").next("tr").children("td").first()
Check out the JQuery traversing documentation.
Upvotes: 4