Latest solutions
Latest comments
- @alibeniaminali@mahen2-cmd
Great Job Ali!
I just solved the challenge with the background color changing when the input is :checked. You might want to look at my solution.
https://www.frontendmentor.io/solutions/interactive-rating-component-solution-using-html-css-and-javascript-iGOlR8A7xn
Here is what I did:
{ button.addEventListener("click", function() { if (selectedButton) { selectedButton.classList.remove("highlight"); } button.classList.add("highlight"); selectedButton = button; }); });
and added css
.highlight {
background-color: hsl(25, 97%, 53%); color: white;
}
Now, whenever a button is clicked the .highlight css is activated and it would change the color of the button.