I have two class in the document but javascript count one code example Example: javascript find total number of classes document.getElementsByClassName("ClassName").length