Menu
When I do only an if statement the iteration loops as expected:
“`
if (list[i].id === page) {
list[i].id.style.display = “block”;
}
But if I add an else statement it stops after the first item:
“`
if (list[i].id === page) {
list[i].id.style.display = “block”;
} else{
list[i].id.style.display = “none”;
}
What am I doing wrong?
Besides this no elements are hidden. Any tip?