On Jun 5, 8:15 pm, Jeztah <webmas...@thecarmarketplace.com> wrote:
> Morning...
>
> Very silly and easy question but my brain isn't working today....
>
> How can i get the last row of a table (table id="foo") ...

Tables have a rows collection that includes all rows in the table.
Try:

  var rows = document.getElementById(tableID).rows;
  var lastRow = rows[rows.length -1];

Or if you want something much faster in IE:

  var rows = document.getElementById(tableID).getElementsByTagName
('tr');
  var lastRow = rows[rows.length -1];


--
Rob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to