Design comparison
SolutionDesign
Solution retrospective
Did I use the best practice for my functions? I selected by element ID, should I have used classes instead or querySelectorAll?
Community feedback
- @JorgeIturrietaPosted over 2 years ago
Hi Adrianna!! Good Job! Offcourse you can selected by element id.
A little detail about your code :
button.addEventListener("click", clickRatingBtn); submitRatingBtn.addEventListener("click", ratingSubmit); });
In every loop of forEach you are assigning the same event for submitRatingBtn element :
submitRatingBtn.addEventListener("click", ratingSubmit);
So you can move this line and put it outside
button.addEventListener("click", clickRatingBtn); }); submitRatingBtn.addEventListener("click", ratingSubmit);
On the other hand the card must be centered.
You can do that in your main tag instead container class.
display: flex; justify-content: center; align-items: center; min-height: 100vh;
I hope you are well and keep it up !
0
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