Say I select an element the old fashioned way (or any other way by which a DOM reference might be obtained):
var el = document.getElementById('myFavoriteElement');
Then I remove that element's parent from the DOM, thus removing el
as well. Or I just remove el
directly.
Is there a way to check whether el
is still a valid reference, whether the HTML to which it refers still exists in the DOM? Something along the lines of el.hasBeenDestroyed
as a boolean attribute, or something like that?