count tags by class in js code example Example: get count of div by class var numItems = $('.item').length;