jQuery - select the second row in a table? jQuery - select the second row in a table? jquery jquery

jQuery - select the second row in a table?


$('.myclass tr').eq(1)

This will grab the second one.


Use the nth-child selector. See http://api.jquery.com/nth-child-selector/

$('.myclass tr:nth-child(2)')


Use the :first selector in combination with the insertAfter() function:

$("TheElementToInsert").insertAfter(".myClass tr:first");