Mustapha George Mustapha George - 18 days ago 5
jQuery Question

jQuery - select the second row in a table?

How do I target the second

<tr>
in a table using jQuery? Do I use
.closest
or
nth-child
?

// something like this..
var MyLocation = $('.myclass').closest('tr').after('tr'); // fixed


<table class ='myclass'>
<tr>
<td></td>
</tr>
<!-- put some thing here -->
<tr>

</tr>

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

This will grab the second one.

Comments