$.fn.greenify = function() { this.css( "color", "green" ); return this; // make your function chainable } $( "a" ).greenify(); // Makes all the links green.