Skip to content
  • Learning paths
  • Challenges
  • Solutions
  • Articles
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 3 years ago

Responsive review page using HTML, CSS, and Vanilla JS

Justin Gorelik•100
@jgorelik23
A solution to the Interactive rating component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


How should I go about making the buttons act like radio buttons? When you click the submit button, it deselects the number buttons.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Nika•180
    @nikavolk
    Posted about 3 years ago

    Hello Justin!

    I had a look through your code and there doesn't seem to be anything wrong on the JS side.

    However, in your HTML file, I think you would need to use <input type="radio"> for each choice and group them up, instead of using buttons for each rating. I believe doing it that way the chosen rating will stay selected upon clicking the Submit button.

    Marked as helpful

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
Frontend Mentor logo

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

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub