Design comparison
Solution retrospective
I've had challenges with keeping track of the toggled state, say If I triggered an onmousedown event on a div element. I need to remove that event as soon as I've triggered the event to another div, that way I won't have more than 2 active divs. thanks
Community feedback
- @CuriousoCharliePosted about 2 years ago
I noticed your submit button doesn't change colors when you click it. This can be solved by using button:active in css and adding applicable styles there. They'll display as its being clicked. As for dealing with the rating numbers themselves in javascript, I opted to have a variable that keeps track track of the last rating clicked. Initially set to -1, when a user clicks a rating, the previous rating variable will be set to what is clicked. Then if another rating is chosen, you can deal with the previous rating. You can check my solution. While I'm sure there are better ways of doing it, it gets the job done.
Marked as helpful0@hakizimana-fredPosted about 2 years ago@CuriousoCharlie Thank you! I will definitely check your solution
0
Please log in to post a comment
Log in with GitHubJoin 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