[jQuery] Re: Adding a new row

2008-09-10 Thread Karl Swedberg
Brian's solution should work fine, except that clicking on the new row's button won't create another new row, because the event isn't being cloned along with the element. To clone events as well, use .clone(true) instead of .clone(). Also, if you're dealing with 100 or more rows, you might

[jQuery] Re: Adding a new row

2008-09-10 Thread Brian Schilt
You can use the .clone() method to achieve this. When the button is clicked, clone the last row of the table then change any specific IDs. $('.button').click(function(){ var newRow = $('table tbody tr:last').clone(); $('table tbody').append(newRow); }); Brian On Sep 10, 7:29 am, Babu PCA <[