Reputation: 26182
So for example I what that after automaticaly execute come code after I call el.html("...") how do I override the cored method for specific element?
I found that http://www.bennadel.com/blog/1624-Ask-Ben-Overriding-Core-jQuery-Methods.htm but I can not get how override core method only for a particular element.
Upvotes: 0
Views: 1123
Reputation: 16591
Why not just filter the current object and loop through the items you want? Something like this should work:
(function(){
var original = jQuery.fn.append;
jQuery.fn.append = function(){
this.filter("yourselector").each(function(){
// Do stuff
});
return original.apply(this, arguments);
}
})();
Upvotes: 2