I've an warning that "Don't make functions within a loop", I know there are already some post regarding this Don't make functions within a loop
But I'm newbie and has no idea how to do this, can anyone help?
for (const el of testing) {
el.addEventListener("click", function() {
const apple = this.dataset.open;
document.getElementById(apple).classList.add(orange);
});
}