change()
function works and detects changes on form elements, but is there a way of detecting when a DOM element\'s content was changed?
This does not w
Try this, it was created by James Padolsey(J-P here on SO) and does exactly what you want (I think)
http://james.padolsey.com/javascript/monitoring-dom-properties/
Try the livequery plugin. That seems to work for something similar I am doing.
http://docs.jquery.com/Plugins/livequery
I wrote a snippet that will check for the change of an element on an event.
So if you are using third party javascript code or something and you need to know when something appears or changes when you have clicked then you can.
For the below snippet, lets say you need to know when a table content changes after you clicked a button.
$('.button').live('click', function() {
var tableHtml = $('#table > tbody').html();
var timeout = window.setInterval(function(){
if (tableHtml != $('#table > tbody').
console.log('no change');
} else {
console.log('table changed!');
clearInterval(timeout);
}
}, 10);
});
Pseudo Code: