Interactive Rating Component - CSS Design and JavaScript

Solution retrospective
My FIRST JavaScript challenge, it took me 4 hours to finish this. 😅 In the end, it seems to work well, however, there are 2 things I don't know how to make it work yet.
-
I use toggle to apply "active" class when user clicks the rating value, but it didn't apply the CSS property in the end. (It should show and keep the primary orange color when the button is clicked.)
-
How can we just show mainly the latest button with active class, when the user click it. They could click many times with different values, but how can we just show the latest clicked?
If you know how to solve the problems or any idea, welcome to give me any advice, thanks for helping. :)
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Pon Huang's solution.
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord