Interactive rating component challenge on Frontend Mentor using HTML C
Design comparison
Community feedback
- @grace-snowPosted 7 months ago
I'm afraid you need to rewrite the html on this one. This is a challenge where there really is only one correct approach for the markup. This must be a form and use radio inputs. Ideally they need to be in a fieldset with a legend, or a wrapping div with role of "radiogroup" and an aria-labelledby pointing to the headings ID.
The bad news is that changing the html will break your styles and javascript.
But the good news is the js will become way more simple. This only needs a single form submit event listener, and you can get the chosen value from the form data. For example if the radios have a name of "rating" you would get the value with
form.rating.value
.Marked as helpful1
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