I have a code which deletes a tr and regenerate tr\'s id sequence wise. But It works on tr click and I want to do this on a button click. How I do this.
Here is my code<
First thing is - Ideally you shouldn't put the same id values of all the rows. id is for unique identifier in the entire DOM.
Next is - As you are doing with $(tr), it will take the entire row.
You can try something like:
$("[name=btn]").click(function () {
$(this).parents('tr').remove();
});
to remove the desired row on click of the button.
For rest of the manipulations, you can add your logic.