Skip to content

Instantly share code, notes, and snippets.

@remy
Created January 26, 2010 19:00
Show Gist options
  • Save remy/287106 to your computer and use it in GitHub Desktop.
Save remy/287106 to your computer and use it in GitHub Desktop.
attrMutationDetection
var mutationSupported = (function () {
var el = document.createElement('div'),
mutationSupported = false;
function detectMutation() {
mutationSupported = true;
this.removeEventListener('DOMAttrModified', detectMutation, false);
}
el.addEventListener('DOMAttrModified', detectMutation, false);
el.setAttribute('foo', 'bar');
return mutationSupported;
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment