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 Misc size() Method

❮ jQuery Misc Methods

Example

Alert the number of elements matched by the jQuery selector:

$("button").click(function(){
  alert($("li").size());
});

Definition and Usage

The size() method was deprecated in version 1.8 and removed in jQuery version 3.0. Use the length property instead.

The size() method returns the number of elements matched by the jQuery selector.


Syntax

$(selector).size()

❮ jQuery Misc Methods