how to how many elements have same class in js code example Example: javascript find total number of classes document.getElementsByClassName("ClassName").length