Skip to content

Instantly share code, notes, and snippets.

@brandonsheppard
Created September 11, 2017 04:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brandonsheppard/8aa77c4b061287e437a9beaec0a3b210 to your computer and use it in GitHub Desktop.
Save brandonsheppard/8aa77c4b061287e437a9beaec0a3b210 to your computer and use it in GitHub Desktop.
Simple mutation observer
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
console.log(mutation.type);
});
});
observer.observe(document.getElementById('bill_selector'), {
attributes: true,
childList: true,
characterData: true
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment