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

Interactive rating component solution -- Radio Buttons with Plain JS

Ting-Huei Chen•180
@hejkeikei
A solution to the Interactive rating component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Any feedback will be much appreciated :)

How I did it:

  • I loop through all the radio button and pass the iterative object to query selector to dynamically get the option that user select.
  • Get user's input value when the submit button have been click on then show it in DOM.

Question: I would like to try to go with object oriented way such as event target to select an element in the group so that I don't have to write loops all the time. If anyone know please tell me I'll be super thankful.

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 Ting-Huei Chen'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