jquery check how many elements have class code example Example: get count of div by class var numItems = $('.item').length;