Для htmlCollection javaScript

var list = document.getElementsByClassName("class-name");
for (let item of list) {
    console.log(item.id);
}
Uninterested Unicorn