I have a table with an Add button on the end. When you click this button I want a new table row to be created underneath the current one. I also want the input fields on thi
Is very simple to clone the last row with jquery pressing a button:
Your Table HTML:
ID
Header 1
1
Line 1
JS:
$(document).on('click', '#addRowButton', function() {
var table = $('#tableExample'),
lastRow = table.find('tbody tr:last'),
rowClone = lastRow.clone();
table.find('tbody').append(rowClone);
});
Regards!