Reputation: 139
I have a form which does a small calculation and display data in table rows. I have also added a button to remove each row at the end. But when I do the calculation couple of times the button gets duplicated. Please refer to the image below.
Following is how I append the button
$(document).ready(function () {
$('#calculate').click(function () {
var removeBtn = $('<button class="removeBtn" id="removeBtn">Remove</button>');
$('.row-time').append(removeBtn);
});
});
I don't understand why the button gets duplicated everytime I add a new row.
Upvotes: 0
Views: 62