When you use Node.removeChild() it return to you the removed node.
Then you can append it again on your DOM, if need.
So, logically, it stay on memory to make it possible. You can check it on http://jsfiddle.net/6QtjD/.
My doubt is: if I remove too many nodes, setting the removed node to a var locally, it'll stay on memory until page change or until the end of scope?
For instance: if I create 1000 nodes and remove all, every 0.1 second. In 10 seconds my page will use the space of 100.000 nodes on memory?
function create1000() {
var div, i;
for(i=0; i<1000; i++) {
div = document.createElement("div");
div.innerText = i;
document.body.appendChild(div);
document.body.removeChild(div);
}
}
for(var i=0; i<10000; i+=100)
setTimeout(create1000, i);
Thanks!