get values by class name jquery and count occurrences code example Example: get count of div by class var numItems = $('.item').length;