Interactive Rating

Solution retrospective
My JavaScript is not working. Please help me fix it.
Please log in to post a comment
Log in with GitHubCommunity feedback
- @gideon-del
Hi Jack. The card is really nice 👍.
I suggest that you add a focus class on the buttons.
rate:focus { /* Your style*/ }
Add an for..in loop to your rateBtn variable and add event listener that will store the textContent in Number format of the button
for (let i = 0; i < rateBtn.length; i++) { rateBtn[i].addEventListener("click", function () { rate = Number(rateBtn[I].textContent); }); }
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