SyntaxFix
Write A Post
Hire A Developer
Questions
With jQuery you can use
jQuery
$('#main-div .specific-class').length
otherwise in VanillaJS (from IE8 included) you may use
IE8
document.querySelectorAll('#main-div .specific-class').length;