var a = document.getElementsByClassName("someClass");
for(var x = 0; x < a.length; x++) { // code }
Array.from(document.querySelectorAll(".some-class")).forEach(function (element, index, array) { ... });