Reputation: 5792
I am adding image from php using ajax. I want to process image after getting it on DOM. I am able to load the image. but I cannot figure it out how to detect in jquery for newly inserted DOM element.
I tried with this:
document.addEventListener("DOMNodeInserted", function(event) {
alert($(event.target).parent()[0].tagName);
});
But, It's little bit different thing.
Upvotes: 0
Views: 367
Reputation: 72
For elements loaded post DOM load, you can use bind()
or on()
http://api.jquery.com/on/ https://api.jquery.com/bind/
It would be helpful if you provided more details on what you are trying to do exactly.
Upvotes: 1