I am dynamically inserting a row into a table with JQuery using clone.
$('#Clone').click(function() {
//put jquery this context into a var
var $btn = $(this).parent();
//use .closest() to navigate from the buttno to the closest row and clone it
//use clone(true) to pass events to cloned item
var $clonedRow = $btn.closest('tr').clone(true).insertAfter($btn);
});
The end user will control the insertion of new rows. I need to limit the number of new rows to 5. Is there a way to do this with a cookie or some other method (array). I could have multiple tables with there own unique id so it needs to work with multiple tables on the page.
Hope you can help.
Thanks,
Rob