JS dla i w kolekcji HTML

var list = document.getElementsByClassName("events");
for (let item of list) {
    console.log(item.id);
}


// To include older browsers (including things like IE), this will work everywhere:
var list= document.getElementsByClassName("events");
for (var i = 0; i < list.length; i++) {
    console.log(list[i].id); //second console output
}
Mysterious Macaw