What is jquery length

藏色散人
Release: 2021-11-15 10:36:18
Original
2533 people have browsed it

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
Copy after login

Example

Number of output

  • elements:

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

    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!

  • Related labels:
    source:php.cn
    Statement of this Website
    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
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template