@HollowZll
Posted
document.querySelector('.ratings').onclick = function(event) { console.log("event", event); changeNumber(event); let clicked = event.target.innerHTML; let color = event.target; color.style.backgroundColor = orange; color.style.color = white; console.log("esto es un rating", rating ); };
I did it by selecting the whole range of buttons by selecting the div where all the ratings were. (.ratings). ----> then onclick ----> selected the button with the variable color ----> then use the .style for it to stay orange. Hope this helps in some way :)
Marked as helpful