cycling jQuery_Succinctly | Page 87

})(jQuery); jQuery('#counter1, #counter2').count(); Using the each() function is critical if you would like a plugin to employ implicit iteration. Plugin returning jQuery object so jQuery methods or other plugins can be chained after using plugin Typically, most plugins return the jQuery object itself so that the plugin does not break the chain. In other words, if a plugin does not specifically need to return a value, it should continue the chain so that additional methods can be applied to the wrapper set. In the code below, we are returning the jQuery object with the return this; statement so that chaining will not be broken. Notice that I am chaining on the parent() and append() methods after I call the count() plugin. Sample: sample86.html
Notes: It is possible to make the plugin a destructive method by simply not returning the jQuery object. 87