Design comparison
Solution retrospective
I would appreciate any advice or improvement.
I want to know how to improve the js, especially on the label creation maybe using classes.
I want to know another way to check for a selected rating without using a hidden radio box.
Community feedback
- @RajSanjelPosted over 2 years ago
Yes you can do it without hidden radio button too. You can add event listener to the number and add class like "selectedRating" or anything you like and style it a bit. What this does is when you click on any number it add selectedRating class and styles it and when submit is clicked you can add another event listener which gets the innerText of element with class selectedRating and you can pass that to the inner text in thank-you section. You can see example by clicking here
If you have any confusion you are free to ask.
Marked as helpful0
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