1 line
1002 B
JSON
1 line
1002 B
JSON
{"name":"length","type":"property","title":".length","deprecated":null,"removed":null,"desc":"The number of elements in the jQuery object.","categories":["properties/jquery-object-instance-properties","version/1.0"],"entries":[{"return":"Integer","signatures":{"added":"1.0"},"examples":{"desc":"Count the divs. Click to add more.","code":"\n$( document.body )\n .click(function() {\n $( document.body ).append( $( \"<div>\" ) );\n var n = $( \"div\" ).length;\n $( \"span\" ).text( \"There are \" + n + \" divs.\" +\n \"Click to add more.\");\n })\n // Trigger the click to start\n .trigger( \"click\" );\n","css":"\n body {\n cursor: pointer;\n }\n div {\n width: 50px;\n height: 30px;\n margin: 5px;\n float: left;\n background: green;\n }\n span {\n color: red;\n }\n","html":"<span></span>\n <div></div>"},"longdesc":"\n <p>The number of elements currently matched. The .<a href=\"/size/\">size()</a> method will return the same value.</p>\n "}]} |