The jQuery .length method allows you to find out how many items there are for a specified object. 

Note the when you are using .length in your code, it is not followed by a pair of parentheses. You will often use this for assigning a value to a variable or to determine the number of loop iterations to make. 

$("#calcNum").click(function(){
    var listLength = $("#treeType li").length;
    $("#showNum").html(listLength);
});

The script above is determining how many <li> tags there are in the element with id="treeType".

The HTML for this:

<ul id="treeType">
    <li>Maple</li>
    <li>Oak</li>
    <li>Locust</li>
    <li>Magnolia</li>
    <li>Willow</li>
    <li>Hawthorne</li>
    <li>Walnut</li>
    <li>Spruce</li>
</ul>
<p id="calcNum">Calculate Number</p>
<p id="showNum">&nbsp;</p>

The result: