I\'m trying to remove everything in the whole body, except of a single element and its children. How can I accomplish this?
Edit 1 Consider the foll
I think that
$("body *").not("body #div2") .not("body #div2 #elementtokeep") .not("body #div2 #elementtokeep *") .remove();
is the easiest way to focus it.
http://jsfiddle.net/6vb2va6g/