How can I add a dynamic row to the existing records in jQuery. I am getting some records in php. At the bottom there is an 'Add More Rows', which clones the last row. There are some existing calculations happening in the rows on a trigger like changing the selection will do some calculations, this newly created dynamic rows should adapt those calculations. Here in this case when I click Add New Rows, its adding the complete table. I just need the last row to append. Also the new created row is not taking any calculations. Anyone to guide me plsss? I have uploaded the script to the fiddle.
Fiddle
This is the script iam using to create dynamic rows:
$(window).load(function () {
jQuery(document).ready(function ($) {
$("#add_more").on('click', function (e) {
e.preventDefault();
var clone = $(".clone_row").eq(0).clone();
$("#cart1").append(clone);
});
$("#submit").on('click', function (e) {
e.preventDefault();
alert($("#cart1").serialize());
})
})
});