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
You can add a callback option to html (,or any) function:
$.fn.oldHtml = $.fn.html;
$.fn.html = function(html,fn){
fn = fn || function(){};
var result = this.oldHtml(html);
fn();
return result;
};
$('body').html(11,function(){alert("haha");});
Demo here.
You do the change on some element, not the element is forced to change by something that you have to catch.