Interactive-rating-component with HTML, CSS, JS.

Solution retrospective
- I'm proud of completing yet again another FEM challenge.
- I had a little headache over my strategy to tackling the project but once i had that implemented it was a landslide from here.
- I'd like help with alternative approach to the project as well as best practices.
Please log in to post a comment
Log in with GitHubCommunity feedback
- @Crystalis89
Visually looks about right, aside from size which I got same issue, and made use of semantic HTML which most of the ones I have reviewed on my prior submissions didn't.
For the Javascript you can replace some of it with the :checked pseudoclass in the CSS to change their style if the radio button has been selected. And another way to do the text is using textContent, or innerHTML but that one is bit less secure and kind of overkill for this.
In mine I also included an alert in the JS for in case I tried to submit without choosing a rating, although there other ways could display an error too I am not sure what best practice there is.
https://www.freecodecamp.org/news/innerhtml-vs-innertext-vs-textcontent/
https://developer.mozilla.org/en-US/docs/Web/CSS/:checked
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