jquery count elements
snippet in javascript

jquery count elements

user9101

var count_elements = $('.class').length;

jquery li count in ul

user7063

$('#menu ul').filter(function(){ return $(this).children("li").length > 1 })