Answers for "JS get number of classes in html"

1

JS get number of classes in html

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

jQuery
$('#main-div .specific-class').length
Posted by: Guest on September-07-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language