I have a link inside of a table that, when clicked, removes the entire parent tr
. I am using detach()
for the purposes of restoring that item later ba
Why not use an array?
var deleted = [];
//Allow people to delete rows
$('a.delete').click(function() {
deleted.push($(this).parent().parent().detach());
});
//Restore all
$('a.restore').click(function() {
$.each(deleted, function(i, v) {
$('#teams').append(v);
});
});
http://jsfiddle.net/wirey00/nErDy/2/