[jQuery] remove tr
[jQuery] remove tr
Hi,
I have a cloned row(s) and a function to remove selected cloned row
function remove_row(){
$('a.remove').click(function(){
$(this).parents("tr").remove();
});
}
the problem is that i have to click twice on the link before anything
happens (deletes row) and i don't know why...it works after that...so
to delete first row i have to click twice on the link to remove the
second row i can click only once...it doesn't matter which row i try
to remove...
the link is:
<tr>
<td>...</td>
....
<td><a href="javascript:remove_row();" class="remove">delete row</a></
td>
</tr>