Submitted almost 2 years ago
Interactive Rating Component
@aimaduddin
Design comparison
SolutionDesign
Community feedback
- @AdrianoEscarabotePosted almost 2 years ago
Hi Aima Aimaduddin bin Bollhasan, how are you? I really liked the result of your project, but I have some tips that I think you will enjoy:
To make the submit button work only when the user selects a number, we can do this:
ratingButtonEl.forEach(rating => { rating.addEventListener("click", () => { userSelectionEl.innerHTML = rating.innerHTML submitButtonEl.addEventListener("click", () => { ratingCardEl.classList.add("hidden") resultCardEl.classList.remove("hidden") }) }) });
The rest is great!
I hope it helps... 👍
Marked as helpful1@aimaduddinPosted almost 2 years ago@AdrianoEscarabote
Hi Adriano. Thank you for the suggestion. Didn't aware of that flaw 😁 Done fixing it.
1
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