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
Request path contains unescaped characters
Not Found
Not Found
Not Found

Submitted

Interactive Rating Component with Flexbox

AlexMagargiuβ€’ 120

@AlexMagargiu

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


First time writing JS, please do give criticism if I could improve anywhere. I taught about implementing a for in the getValue() function but I don't know how / don't know if it's better optimized than with the single if else condition I used.

Community feedback

P
ApplePieGiraffeβ€’ 30,545

@ApplePieGiraffe

Posted

Hey, AlexMagargiu! πŸ‘‹

Well done on this challenge! πŸ‘ I think you did a good job on the styling and your solution looks good! πŸ‘

I would suggest leaving the alt text for the icon and maybe even illustration in this challenge empty, since they aren't relevant to the content of the page and we don't really want them to be noticed and read by screen readers.

And a small tip for your JSβ€”rather than call getValue inside of switchDisplay, you can call switchDisplay inside of getValue if the user has selected an option. This will make your code slightly easier to follow and you won't have to bother with returning a boolean from getValue. πŸ˜‰

Keep practicing and with time you'll find better and better solutions to problems you encounter. πŸ‘

Hope you find this helpful. 😊

Keep coding (and happy coding, too)! 😁

1

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