get total length of elements until class jquery code example Example: get count of div by class var numItems = $('.item').length;