count how many usages of class on page vanilla code example Example: javascript find total number of classes document.getElementsByClassName("ClassName").length