Web
jQuery
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: $("a")
.filter(".clickme")
.click(function(){
alert("You are now leaving the site.");
})
.end()
.filter(".hideme")
.click(function(){
$(this).hide();
...