foreach document.getElementsbyclassname
const elements = document.getElementsByClassName('myclass');
Array.from(elements).forEach(element => console.log(element));
krylic
const elements = document.getElementsByClassName('myclass');
Array.from(elements).forEach(element => console.log(element));
var selector = document.getElementsByClassName('class-name');
//use this instead
document.querySelectorAll(".myclassname");