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
$("body > *").not("body > #elementtokeep").remove();
You can replace the not() part with whatever you want to keep