Credit to devdocs.io

dom_events

dom_events

DOMSubtreeModified

Example

The following code will display the time of last DOM Change on the title bar of the page.

This event has been deprecated in favor of the Mutation Observer API

This event can cause infinite loops if you decide to change the DOM inside the event handler, hence it has been disabled in a number of browsers (see
DOMAttrModified and DOMSubtreeModified events are no longer fired when style attribute is changed via CSSOM for example).
document.body.addEventListener('DOMSubtreeModified', function () {
  document.title = 'DOM Changed at ' + new Date();
}, false);

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/Events/DOMSubtreeModified