Please note, this is a STATIC archive of website www.w3schools.com from 05 May 2020, cach3.com does not collect or store any user information, there is no "phishing" involved.
THE WORLD'S LARGEST WEB DEVELOPER SITE

jQuery length Property

❮ 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