Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Create your own custom jQuery functions
// Declaring a new jQuery function
(function ($) {
$.fn.newSuperCoolFunction = function () {
return this.each(function (_, selector) {
var elements = $(selector)
elements.each(function (_, elementSelector) {
var element = $(elementSelector);
// Call the new function
$(document).ready(function() {
Make me super cool
Make me super cool
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment