i have a little problem with passing the index to eventlistener in for loop.
for (var i = 0; i < todos.length; i++) {
console.log("XD");
todos[i].addEventListener("mouseover", function() {
trashShow[i].style.display = "inline";
});
}
Communicate shows up that say "Cannot read property 'style' of undefined". I think that the index is just wrong so there is not this element in the array.
Thanks for help.
No comments:
Post a Comment