item
is a dom element not a jQuery object
You need to wrap it in $()
to use jQuery methods
function deleteLine(item){
$(item).closest('tr').remove();
}
3
solved Javascript .closest()/.next()/.siblings() method to remove row in table
item
is a dom element not a jQuery object
You need to wrap it in $()
to use jQuery methods
function deleteLine(item){
$(item).closest('tr').remove();
}
3
solved Javascript .closest()/.next()/.siblings() method to remove row in table