Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
83
rated 0 times [  89] [ 6]  / answers: 1 / hits: 36658  / 12 Years ago, mon, october 8, 2012, 12:00:00

I have a series of slides based off of sections:



<div id=slides>
<section id=first>
<section>
<table>
<thead>
</thead>
<tbody>
<tr id=somethingUnique>
...
</tr>
</tbody>
</table>
</section>
<section>
<table>
<thead>
</thead>
<tbody>
<tr id=somethingUnique>
...
</tr>
</tbody>
</table>
</section>
...
</section>
</div>


I need to select grab the ID of the last row from the table in the last section of #first section.



I'm using the following Jquery, getting undefined back...any ideas?



    var lastListItem = $('#first:last-child table>tbody>tr:last').attr(id);
alert(lastListItem);

More From » jquery

 Answers
29
$('#first table:last tr:last')


or:



$('#first tr:last')





http://jsfiddle.net/hunter/QMzHH/


[#82690] Sunday, October 7, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
elijahm

Total Points: 674
Total Questions: 124
Total Answers: 79

Location: Northern Mariana Islands
Member since Fri, Jan 15, 2021
3 Years ago
;