I want to iterate over some DOM elements, I\'m doing this:
document.getElementsByClassName( \"myclass\" ).forEach( function(element, index, array) { //do s
Or you can use querySelectorAll which returns NodeList:
querySelectorAll
document.querySelectorAll('.myclass').forEach(...)
Supported by modern browsers (including Edge, but not IE): Can I use querySelectorAll NodeList.prototype.forEach()
MDN: Document.querySelectorAll()