Skip to content

Instantly share code, notes, and snippets.

@theroux
Last active December 19, 2015 21:29
Show Gist options
  • Save theroux/6020954 to your computer and use it in GitHub Desktop.
Save theroux/6020954 to your computer and use it in GitHub Desktop.
jQuery plugin: collection method
(function ($) {
// Collection method.
$.fn.awesome = function () {
return this.each(function (i) {
// Do something awesome to each selected element.
$(this).html('awesome' + i);
});
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment