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");