get number of elemments with class javascript code example Example: javascript find total number of classes document.getElementsByClassName("ClassName").length