How to select first row of the first table in an html page using jQuery?

$("table:first > tr:first")

or

$("table:first").find("tr:first")

or

$("table:first").children("tr:first")

or

$("table").eq(0).children("tr").eq(0)

So if I understand the followup question…

$("table:eq(1) tr:has(table:eq(2))")

translates to: get any tr’s in the 2nd table’s if the tr has a 3rd table

or

$("table").eq(1).children("tr:has(table:eq(2))")

Leave a Comment