Created
May 31, 2020 21:34
-
-
Save pavr0m/9c6ff4255e775caa1474de11f2c6ee3a to your computer and use it in GitHub Desktop.
Observe DOM Mutatinos in the document
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var say = (msg)=>{ | |
console.log(msg); | |
} | |
const observer = new MutationObserver( (mutationList)=>{ | |
say(mutationList); | |
}); | |
var targetNode = document.querySelector(nodeSelector); | |
observer.observe(targetNode, {subtree: true, attributes: true} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment