There is a table and its Stoblots are displayed on the received id . The question is, I feel that this can be done better than I did now, but how? As an option, write to the array and display on the incoming id ?
for (let i = 0; i < table.length; i++) { switch (id) { case 0: tax[i].style.display = "block"; tax[i].style.display = "none"; tax[i].style.display = "none"; break; case 1: tax[i].style.display = "none"; tax[i].style.display = "block"; tax[i].style.display = "none"; break; case 2: tax[i].style.display = "none"; tax[i].style.display = "none"; tax[i].style.display = "block"; break; } }
case? Only the last will work. - Igor