ubc
jquery.com
learn.jquery.com

Chaining

This works, but there's a couple of things we need to do for our plugin to survive in the real world. One of jQuery's features is chaining, when you link five or six actions onto one selector. This is accomplished by having all jQuery object methods return the original jQuery object again (there are a few exceptions: .width() called without parameters returns the width of the selected element, and is not chainable).
Making our plugin method chainable takes one line of code: return this; Note that the notion of chaining is not applicable to jQuery utility methods like $.trim().