Interactive rating component solution | Responsive |

Solution retrospective
I'm most proud of how I was able to connect all the parts — HTML, CSS, and JavaScript — into a working and visually clean component. It was satisfying to see the "Thank you" screen update dynamically based on user input. It felt like building a real interactive app.
Next time, I would focus more on accessibility and keyboard navigation. I would also consider writing more modular JavaScript code to improve readability and reusability.
What challenges did you encounter, and how did you overcome them?One of the challenges I faced was getting the button interaction to work correctly — when selecting a rating, only one button should be highlighted, and the others should reset. At first, the class wasn’t being applied as expected. I realized that either the JavaScript was running before the DOM had loaded, or the selector was incorrect.
I fixed this by checking the class names carefully and moving my script to the bottom of the HTML file to make sure the elements existed when the script ran. Another challenge was showing the selected rating on the thank-you screen, which I solved by saving the selection in a variable and inserting it into the DOM on submit.
What specific areas of your project would you like help with?I’d like to get more confident with structuring JavaScript code for better readability and scalability — for example, organizing functions, separating logic, or even using modules.
I'm also curious about best practices for accessibility (a11y), especially when building interactive components like buttons and forms.
In addition, I’d love feedback on how to improve my CSS organization — maybe using BEM more consistently or learning when it's a good idea to switch to utility-first frameworks like Tailwind.
Please log in to post a comment
Log in with GitHubCommunity feedback
- @EdivandroLima
good
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