How to Write Your Own jQuery Plugin

For those who don’t know, jQuery is a JavaScript library that comprises of a number of features, and is quite small yet fast. It also comprises of an easy-to-use API that is compatible on all browsers and enables easier HTML traversal, animation, DOM manipulation, and event handling. It is not only extensible but durable. Hence, client-side scripting has become a lot easier since its development.
What Are jQuery Plugins?
jQuery consists of prototype objects which, at some point, may require some manipulation and extension. For the same purpose, jQuery plugins were devised as a way for objects to inherit any additional methods that are added. Not only that, these additional methods are not isolated but called with the rest of the methods (already inherited) when the jQuery object is created. jQuery plugins are available individually in the form of individual methods that exist in the jQuery library. Every method is a plugin. But, in case of something new, the plugin can also be custom created, which is not very difficult a task.