Interactive rating form

Solution retrospective
Please look at the code and give me feedback on better accessibility techniques
Please log in to post a comment
Log in with GitHubCommunity feedback
- @grace-snow
I'm afraid this needs rewriting. You must learn to use appropriate html, especially on forms.
This is a form with a fieldset of radios. That fieldset must have a legend (or it can be a role radiogroup and use aria-labelledby or aria-label instead of legend).
There should be no, click listeners anywhere in this. Just a form submit listener.
Once that's all changed you'll need to change the styles and js. The good news is the javascript should be much shorter. It only needs a line to grab the rating value from the form and a line to hide/show the panels.
Make sure the thank you is wrapped in an aria-live region or focus moves to it.
And make sure decorative images have empty alt attributes.
Marked as helpful
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