Javascript – How to monitor the DOM for changes

domjavascriptjquery

Is there a way – using jQuery or otherwise – to monitor the DOM for insertions, deletions, updates to styles, etc?

Best Solution

See "MutationEvent" elements in here: https://developer.mozilla.org/en/DOM/DOM_event_reference but those are deprecated.

jQuery now features a way to attach events to existing AND future elements corresponding to a selector: http://docs.jquery.com/Events/live#typefn

It may be a trick you could use for lack of proper DOM Node modification info.