Is there a way to count how many elements on the page with a particular class?
$('.someclass').length
You could also use:
$('.someclass').size()
which is functionally equivalent, but the former is preferred. In fact, the latter is now deprecated and shouldn't be used in any new development.
2.1m questions
2.1m answers
60 comments
57.0k users