English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

jQuery length Property

jQuery Properties

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

Syntax:

$ (selector).length

Example

Remind the number of paragraphs:

$("button").click(function(){
  alert($("p").length);
});
Test and see‹/›

Calculate DIV. Click to add more:

There are two divs here. Click here to add more DIV boxes

Run Code

jQuery Properties