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.

  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
  var lastRow = rows[rows.length -1];

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 
For more options, visit this group at 

Reply via email to