Home  >  Article  >  Web Front-end  >  What is jquery length

What is jquery length

藏色散人
藏色散人Original
2021-11-15 10:36:182532browse

The jquery length property contains the number of elements in the jQuery object. Its usage is as follows: "$("button").click(function(){alert($("li").length);}); ".

What is jquery length

The operating environment of this article: windows7 system, jquery3.2.1 version, DELL G3 computer

What is jquery length?

jQuery length property

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

Grammar

$(selector).length

Example

Number of output 25edfb22a4f469ecb59f1190150159c6 elements:

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

Recommended learning: "jquery video tutorial

The above is the detailed content of What is jquery length. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn