Für HTMLCollection JavaScript
var list = document.getElementsByClassName("class-name");
for (let item of list) {
console.log(item.id);
}
Uninterested Unicorn
var list = document.getElementsByClassName("class-name");
for (let item of list) {
console.log(item.id);
}
/*
Every function like document.getElementById() is a function of
htmlcollection. You can also change it or add new functions to it.
*/
// Examples
HTMLCollection.namedItem()
HTMLCollection.item()
HTMLCollection.length
// How To Extend
HTMLCollection.prototype.class = function (value) {
};
document.getElementById("main").class();