Question: where on the page do you want to return the item back? If, for example, all li elements are returned inside <ul id="foo"></ul> , you can use something like this:
var items = []; $('li.type').fadeOut(300, function() { items.push( $(this).detach() ); }); $('#replace').click(function() { for(var i = 0; i < items.length; i++) { $("ul#foo").append(items[i]); } items = []; });
source share