jQuery length attribute
Example
Output the number of <li> elements:
$("button").click(function(){ alert($("li").length); });
Definition and Usage
The length attribute contains the number of elements in the jQuery object.
Syntax
$(selector.length