Is there some sort of on render function in jQuery. I’d like this function to get triggered whenever a new element with the specified class or ID is added on the screen, either on the page load, or after AJAX requests that return HTML.
Edit: I want a callback that fires whenever a new element with the class or ID that I’ve defined is created. Not when something changes. I’d prefer not to use a plugin.
I’m solving it this way:
This way I can have an array that keeps track of all my elements, and when a HTML change is triggered check if there are elements that are not in my array, thus new elements.