Guest User

Untitled

a guest
Jan 13th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. Jquery Get last row of table within last element in a series
  2. <div id="slides">
  3. <section id="first">
  4. <section>
  5. <table>
  6. <thead>
  7. </thead>
  8. <tbody>
  9. <tr id="somethingUnique">
  10. ...
  11. </tr>
  12. </tbody>
  13. </table>
  14. </section>
  15. <section>
  16. <table>
  17. <thead>
  18. </thead>
  19. <tbody>
  20. <tr id="somethingUnique">
  21. ...
  22. </tr>
  23. </tbody>
  24. </table>
  25. </section>
  26. ...
  27. </section>
  28. </div>
  29.  
  30. var lastListItem = $('#first:last-child table>tbody>tr:last').attr("id");
  31. alert(lastListItem);
  32.  
  33. $('#first table:last tr:last')
  34.  
  35. $('#first tr:last')
  36.  
  37. var lastListItem = $('#first section:last table tr:last').attr("id");
  38.  
  39. var lastListItem = $("#first").find("section").last().find("tr").last().attr("id");
  40.  
  41. ​$("#first")​.find("tr:last").attr("id")
  42.  
  43. $("#first tr:last").attr("id")
  44.  
  45. $('#first section:last-child table>tbody>tr:last').attr("id");
  46.  
  47. $('#first section:last-child tr:last-child').attr("id");
Add Comment
Please, Sign In to add comment