Using MutationObserver for DOM Changes Detection in Javascript


Detect changes to the DOM.

Source Code

const observer = new MutationObserver(mutations => {
  mutations.forEach(mutation => console.log(mutation));
});
observer.observe(document.body, { childList: true, subtree: true });
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments