Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery length Property

jQuery length Property

jQuery Properties jQuery Properties

Example

Output

  • elements:

    $("button").click(function(){

        alert($("li").length);

    });

    Try it »


    Definition and Usage

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


    Syntax

    $(

    selector

    ).length


    jQuery Properties jQuery Properties