print length of same class names in javascript code example Example: getelementbyclass var selector = document.getElementsByClassName('class-name');