<< body> <> < switch course=" score">> A< < switch course=" score">> B<
const buttonList = document.querySelectorAll(". score");.
buttonList.forEach(( component) => > {
element.addEventListener(" click", feature () {
document.querySelector(". score"). classList.remove(" energetic");.
element.classList.add(" energetic");.
} );.
} );.
energetic {background-color: aqua;}
I desired that, when you click a switch it gets a course called "energetic", as well as the others switches if they have that energetic course, it ought to been gotten rid of. Yet when I click the B switch, the energetic course of the A switch is gotten rid of, however when I click the A switch the energetic course still exists in the B switch.