When I delete a DOM element using .removeChild(), the reference to the element still returns it as a valid element:
var someNode = document.getElementById("someid");
if(someNode)
alert('valid element');
else
alert('invalid');
var p = document.getElementById('parent_id');
p.removeChild(someNode);
if(someNode)
alert('valid element');
else
alert('invalid');
Both before and after, I get a "valid" in the alert box. How do I delete the DOM element without this occuring? I tried jQuery's .remove() but it was no better.