Interactive rating card using HTML, CSS, and JS

Solution retrospective
It took me far too long to realize I could just put a div inside of a label for a radio input, in order to center the numbers and still have both the text number and circle the toggle for the radio inputs...
I wanted to keep the card height and style consistent, so rather than make an entirely new card on click, I just used JS to toggle a 'hidden' class on whatever I wanted to show inside the card. I am aware that if this were a bigger project, this kind of thing would be better handled by React but I think this works fine too.
All in all, this took me longer than I thought but I learned a lot along the way!
3/20/22 Update - made changes based on feedback. Hopefully this fixed issues.
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Jaron Paige's solution.
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