I'm trying to add a eventlistenner to every element of this div. But I can't seems to able to access every element of this div. The console.log can print out the table as a list. but it shows an error after I try to use forEach method. Why would that be?
let table = document.getElementsByClassName('pixel');
console.log(table);
table.forEach(item => {
console.log(item)
});