Getting started with jquery-plugins – Using the each() Method

Your typical jQuery object will contain references to any number of DOM elements, and that’s why jQuery objects are often referred to as collections. If you want to do any manipulating with specific elements (e.g. getting a data attribute, calculating specific positions) then you need to use .each() to loop through the elements.

$.fn.myNewPlugin = function() { 
    return this.each(function() {
        // Do something to each element here.
    });
 
    // return the reference for chaining
    return this;
};

if you want to reproduce, please indicate the source:
Getting started with jquery-plugins – Using the each() Method - CodeDay