# .length

## length ( ) Returns: Integer version added: 1.0

Description: The number of elements in the jQuery object.

The number of elements currently matched. The .size() method will return the same value.

## Examples:

#### Example: Count the divs. Click to add more.

    <!doctype html>
    <html lang="en">
    <head>
      <meta charset="utf-8">
      <title>css demo</title>

      <style>

      body {
        cursor: pointer;
      }
      div {
        width: 50px;
        height: 30px;
        margin: 5px;
        float: left;
        background: green;
      }
      span {
        color: red;
      }

      </style>

      <script src="//code.jquery.com/jquery-1.10.2.js"></script>
    </head>
    <body>

    <span></span>
      <div></div>
    <script>

    $( document.body )
      .click(function() {
        $( document.body ).append( $( "<div>" ) );
        var n = $( "div" ).length;
        $( "span" ).text( "There are " + n + " divs." +
          "Click to add more.");
      })
      // Trigger the click to start
      .trigger( "click" );

    </script>

    </body>
    </html>

#### Demo: