FREE Web Template Download
HTML CSS JAVASCRIPT SQL PHP BOOTSTRAP JQUERY ANGULARJS TUTORIALS REFERENCES EXAMPLES Blog
 

jQuery length Property

jQuery Properties jQuery Properties

Example

Alert the number of <li> elements:

$("button").click(function(){
    alert($("li").length);
});
Try it Yourself »

Definition and Usage

The length property contains the number of elements in the jQuery object.


Syntax

$(selector).length

jQuery Properties jQuery Properties