Use disconnect ( ) instead of delete ()
var myremovedElems = $("#table tr:gt(1)").detach();
The .detach () method is the same as .remove (), except that .detach () saves all jQuery data associated with deleted items. This method is useful when deleted items need to be reinserted at the DOM time.
source
share