document events

K

Kobi.Pinhasov

Hi,

I've got several places on page where I'm using the following method
document.createElement to create a new element.

Is there an event that I can attach to which is fired every time a new
node/element added to the DOM using this method.

Thanks in advance
 
V

VK

Hi,

I've got several places on page where I'm using the following method
document.createElement to create a new element.

Is there an event that I can attach to which is fired every time a new
node/element added to the DOM using this method.

If *you* are using document.createElement (and not some subnatural
force :) then what prevents you to call the necessary function?

Also note that createElement doesn't add an element to the DOM. It
*creates* an element you can add later to the DOM using say appendChild
method.

....
var obj = document.createElement('DIV');
....
notifyListener(document.body.appendChild(obj));
....

function notifyListener(obj) {
// do what you want
}

If there is some extra specifics in your situation then please explain
it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top