How do I make only one class div element changeable, so that if one is clicked, others can't be? Javascript
I’m trying to make a rating system, so that only one div at a time can be changed, but all of them can still be clicked. const number = document.getElementsByClassName(‘number’); function changeColor(arg) { arg.addEventListener(‘click’, () => { arg.style.backgroundColor = ‘hsl(216, 12%, 54%)’; arg.style.color = ‘white’; }) } for (let i = 0; i < number.length;… Read More How do I make only one class div element changeable, so that if one is clicked, others can't be? Javascript