JS obtiene número de clases en html
VanillaJS
document.querySelectorAll('#main-div .specific-class').length;
jQuery
$('#main-div .specific-class').length
Blue Duck
VanillaJS
document.querySelectorAll('#main-div .specific-class').length;
jQuery
$('#main-div .specific-class').length