Run a function when a DOM element is created

Posted by Ed Woodcock on Stack Overflow See other posts from Stack Overflow or by Ed Woodcock
Published on 2010-03-09T10:45:11Z Indexed on 2010/03/09 10:51 UTC
Read the original article Hit count: 262

Filed under:
|
|

Hi folks,

I want to bind an event to a certain class and ID for when matching objects are created in the DOM.

I am doing this as I have some jQuery code in an ASP UpdatePanel, which causes the DOM to be re-loaded on its partial postback. I have reset the events with live(), however I need to call a 2 line initialisation function as soon as the elements are created.

Is there any way to attach this to live(), or some other jQuery function, or will I have to write code to do this myself?

Thanks, Ed

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about ASP.NET