Skip to content

Instantly share code, notes, and snippets.

@VicVicos
Created March 23, 2017 05:38
Show Gist options
  • Select an option

  • Save VicVicos/80ae8db90147dfdac00728d411d678bd to your computer and use it in GitHub Desktop.

Select an option

Save VicVicos/80ae8db90147dfdac00728d411d678bd to your computer and use it in GitHub Desktop.
Observer JavaScript
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutationRecord) {
// My Function
});
});
var target = document.querySelector('.element');
observer.observe(target, {
childList: true,
subtree: true,
attributes: false,
characterData: false,
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment