I would like to modify a DOM subtree and restore it after a while. How can I save a sub-tree copy aside (to play with the actual subtree)? How can I restore the saved copy a
you can use $.data()... method
$.data()
$.data(document.body, "sortElement", "0"); //set value $.data(document.body, "sortElement"); //read value
this was you can store all waht you want in a dictionary type - and then reuse it later.
http://api.jquery.com/jQuery.data/