how to count elements with same class in jquery code example Example: get count of div by class var numItems = $('.item').length;