Interactive rating component

Please log in to post a comment
Log in with GitHubCommunity feedback
- @MohanadOO
Great Work, I liked how you did the flip animation when pressing the submit button.
I would suggest one more thing that I did is to disable the button when there is no button is selected.
To do that you have first to change
<button></button>
to be an<input type="button" value="Submit"/>
and probably you have to addtext-align: center
to center the text.After that in your script you can disable the button onload by adding:
const submitbtn = document.querySelector('.submit') window.onload = () => { submitbtn.disabled = true }
You can style the button when it is disabled in the CSS like this:
.submit:disabled { background-color: hsl(25, 97%, 53%, 40%); pointer-evnets: none; }
And finally, when the user clicks on any of the review buttons it should remove the disabled attribute from the submit button it can be done by making it false
submitBtn.disabled = false
I hope this adds something useful for you! 😀👍
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