We insert a plugin file that closely resembles a jQuery library file in thedocument to make plugin methods available to us.
This is very easy to write your plugin. The following is a syntax for building a path -
Here methodNameM is the name of the new method, and method definition is the definition of the actual method.
In the end, any path or function you paste should be semicolon (;).
Your method should return a jQuery item unless the specification is otherwise specified.
You should use this.each to scale over the current set of compatible items - it produces clean and consistent code that way. 4.
Start the file name with jquery, follow that with the plugin's name, and end with .js. Always attach the plugin to jQuery directly instead of $, so users can use the custom alias in the noConflict () way.
Use of jquery. Start eliminates any possible word conflicts with files for use with other libraries.