Skip to content

Instantly share code, notes, and snippets.

@simondahla
Created June 10, 2014 14:59
Show Gist options
  • Save simondahla/0c324ba8e6ed36055787 to your computer and use it in GitHub Desktop.
Save simondahla/0c324ba8e6ed36055787 to your computer and use it in GitHub Desktop.
var myElement = document.getElementById('IDoftheDIV');
if(window.addEventListener) {
// Normal browsers
myElement.addEventListener('DOMSubtreeModified', contentChanged, false);
} else
if(window.attachEvent) {
// IE
myElement.attachEvent('DOMSubtreeModified', contentChanged);
}
function contentChanged() {
// this function will run each time the content of the DIV changes
}
@angelxaces
Copy link

It works...

...and if the the change your listening for involves a list being iterated, you get to watch it work ' + list.length-1 + " times in rapid succession!

@mssuath
Copy link

mssuath commented Jul 11, 2024

Thank you very much work fine and simple and clean

@ivan19940106
Copy link

You saved me! Thank you so much!!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment