events for every time dom changes code example
Example: jquery on dom change
$("#someDiv").bind("DOMSubtreeModified", function() {
alert("tree changed");
});
$("#someDiv").bind("DOMSubtreeModified", function() {
alert("tree changed");
});