The below jquery snippet is working fine. I want to know how to write it as function which accepts the table1 as a parameter so that I can reuse this function in other section of the code. For e.g. If I have table with id table2 instead of adding new function I should re use the existing one
$(document).ready(function(){
$("#table1").on('click','.btnDelete',function(){
$(this).closest('tr').remove();
});
});