According to spec, only the BODY
and FRAMESET
elements provide an \"onload\" event to attach to, but I would like to know when a dynamically-create
Neither of DOMNodeInserted or DOMNodeInsertedIntoDocument events is supported in IE. Another missing from IE [only] feature of DOM is compareDocumentPosition function that is designed to do what its name suggests.
As for the suggested solution, I think there is no better one (unless you do some dirty tricks like overwriting native DOM members implementations)
Also, correcting the title of the question: dynamically created Element is part of the DOM from the moment it is created, it can be appended to a document fragment, or to another element, but it might not be appended to a document.
I also think that the problem you described is not the problem that you have, this one looks to be rather one of the potential solutions to you problem. Can you probably explain in details the use case?