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

Gleb_V 10

@wglebster

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


I completed this challenge with the most basic vanilla CSS and JS. I think that my CSS could be better structured and therefore more concise. I hope this is something that I will be able to achieve when I start using CSS frameworks.

I found JS really difficult - at first, I tried it with named function and loops, but could not get it to work. So I went back to the very basics and ended up with the ugly code as it is right now. I shall come back to it and refactor it at some point.

I would appreciate any pointers about refactoring this JS code.

Community feedback

NicolasBQ 190

@NicolasBQ

Posted

Hey @wglebster, nice solution!! It looks great.

If u want to refactor your JS I recommend u to use the same class name for all the rate buttons, then u can select them all with querySelectorAll and manipulate them as an array. I did it in that way (except I used data attributes), so feel free to check my code.

Good Job!

Marked as helpful

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