$("#foo > div").length
Direct children of the element with the id ‘foo’ which are divs. Then retrieving the size of the wrapped set produced.
$("#foo > div").length
Direct children of the element with the id ‘foo’ which are divs. Then retrieving the size of the wrapped set produced.