Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Interactive Rating Component

Ari Griggs 270

@nevercanon

Desktop design screenshot for the Interactive rating component coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


How could I have made my JS code more efficient rather than adding individual event listeners to each number button? Should the thank-you page have been a different page, rather than a hidden element on the same page? Do you have any critiques on how my CSS was done?

Community feedback

@VCarames

Posted

Hey there! 👋 Here are some suggestions to help improve your code:

Regarding your question,

  1. Your JS should be looking for a form submit.
  2. Either option is fine.
  3. https://moderncss.dev/pure-css-custom-styled-radio-buttons/
  • Your HTML should have a main element that will assist in identifying the main content of your site. In this, case the main element would be wrapping the entire component.

More Info:📚

MDN Main Element

  • To ensure that the "rating buttons" are fully accessible, they need to be built using a form and inside of it, there should be fiveinput radios and each input should have a label attached to it to make the buttons accessible. Finally wrap all the inputs and labels inside a fieldset to prevent users from making more than one selection.

More Info:📚

MDN <input type="radio">

[MDN <fieldset>: The Field Set element](https://developer.mozilla.or

  • Currently, users can submit without selecting a rating. To fix this, you can do one of the following:
  1. Make the “5” rating the default rating.
  2. Create an error message, telling users they need make a section.
  3. Disable the button until a selection is made.

If you have any questions or need further clarification, feel free to reach out to me.

Happy Coding!🎄🎁

Marked as helpful

0

Please log in to post a comment

Log in with GitHub
Discord logo

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