untuk javascript htmlcollection

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