Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
25
rated 0 times [  26] [ 1]  / answers: 1 / hits: 113615  / 12 Years ago, thu, may 24, 2012, 12:00:00

I'm dynamically creating table rows. So each time I add a row, I need to get the ID of the last <tr> so that I can create a new <tr> with ID = (the last row's ID) + 1. Is there any way to get the last row's ID using jQuery?


More From » jquery

 Answers
15
$('#yourtableid tr:last').attr('id');

[#85383] Tuesday, May 22, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
yaquelina

Total Points: 517
Total Questions: 101
Total Answers: 96

Location: Egypt
Member since Tue, Jul 6, 2021
3 Years ago
yaquelina questions
;