This article is taken from How jQuery Works.
jQuery uses an interesting concept called a "Builder" to make its code short and simple. The Builder pattern is an object-oriented programming design pattern that has been gaining popularity.
In a nutshell: Every method within jQuery returns the query object itself, allowing you to 'chain' upon it, for example:
alert("You are now leaving the site.");
Which would work against the following HTML:
<a href="http://google.com/" class="clickme">I give a message when you leave</a>
<a href="http://yahoo.com/" class="hideme">Click me to hide!</a>
<a href="http://microsoft.com">I'm a normal link</a>
Methods that modify the jQuery selection and can be undone with
end(), are the following:
Please check the Traversing API documentation for details of these methods.