I need to watch for an attribute change on any of the children of a specific DOM element. So far, I have been using mutation events.
The problem was - they were bugg
For efficient DOM monitoring with jQuery, you might take a look at the jQuery Behavior Plugin (Disclaimer: I'm the author) which utilizes a optimized version of Live Query. I'm using it in several products for 3 year now, without any problems.
Edit: Listening for attribute changes would work like this:
$.behavior({
'div:first': {
'changeAttr': function (event, data) {
console.log('Attribute "' + data.attribute + '" changed from "' + data.from + '" to "' + data.to + '"');
}
}
});
$('div:first').attr('foo', 'bar');