The following is a standard boilerplate template to use when creating a jQuery plugin. It contains all the major pieces you will need to build out and provide functionality for your plugins. I have used my jQuery tooltip plugin as an example but this can be replaced with anything. Comments have been provided in the boilerplate code to read over. For more detailed explanations read my article on 10 Coding Tips to Write Superior jQuery Plugins which covers each piece in-depth.