Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

JS get number of classes in html

VanillaJS
document.querySelectorAll('#main-div .specific-class').length;

jQuery
$('#main-div .specific-class').length
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #JS #number #classes #html
ADD COMMENT
Topic
Name
7+8 =