For any DOM mutation, do stuff

For any DOM mutation, do stuff.

For example, after each DOM mutation, do alert('DOM was mutated !');.

Is that possible with the current release of JavaScript?

See:

Let me just say that you probably dont want to do it for any mutation. The DOM tends to trigger mutations quite a lot these days…

I find this documentation page quite unclear.

Let me give you an example; after I click some button, a popup appears.
This popup has its own DOM markup and hence, I’d assume this popup to reflect a DOM mutation.
How can I do an action just when that popup appears?

However the popup is made to appear, I expect MutationObserver can detect it.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.