interactive-rating-component-main
Design comparison
Solution retrospective
First, sorry for the bad English, I'm studying and I just started. In this challenge I managed to complete most of it, there were two problems and if someone can help me, it would be amazing.
1 issue -> I could not leave the evaluation buttons (1 to 5) selected, that is, when clicked they should have an orange background color and not return to their initial state (dark blue background color)
2nd issue -> I would like the application not to run if there is no evaluation, that is, if I just click on the submit button, without clicking on the rate (1 to 5) the application should not run. I appreciate the attention you always have with beginners, and before I forget, MERRY CHRISTMAS EVERYONE 🎅🎅
Community feedback
- @Adriangln11Posted almost 2 years ago
Hey, Hi. First of all sorry about my grammar and merry christmas too.!!
1.- About the first issue, you can change the tag div for button on every rate number, and use the pseudoclase :focus to keep the properties on the element selected.
2.- For the second issue you can add a property value on every rate button, with an event listener capture the value of the button selected on a variable initialized already like undefined. Also, on the listener on submit button validate if that variable is still undefined, if its undefined it means any button has been clicked, so you could show like a modal or something, otherway continue with the code normaly.
I hope has been helpfull. Happy Coding!!
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