Is there some way to add methods to jQuery\'s objects?
For example, I have jQuery object
a = $(\'div\')
I\'d like that every object
add it like
$.fn.doSomething = function(data){ // data is the argument passed to doSomething return this.each(function(){ var elem = $(this); //perform operation on elem // like to change background color use elem.css('background-color','red'); }); }