Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 3 years ago

Interactive Rating Component - CSS Design and JavaScript

Pon Huang•210
@ponhuang
A solution to the Interactive rating component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

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.

  1. 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.)

  2. 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. :)

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community 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

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License