How to find with javascript if element exists in DOM or it's virtual (has been just created by createElement)
问题 I'm looking for a way to find if element referenced in javascript has been inserted in the document. Lets illustrate a case with following code: var elem = document.createElement('div'); // Element has not been inserted in the document, i.e. not present document.getElementByTagName('body')[0].appendChild(elem); // Element can now be found in the DOM tree Jquery has :visible selector, but it won't give accurate result when I need to find that invisible element has been placed somewhere in the