Design comparison
SolutionDesign
Solution retrospective
My JavaScript is not working. Please help me fix it.
Community feedback
- @gideon-delPosted over 2 years ago
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 helpful0@gideon-delPosted over 2 years ago@Jack-WebDev Instead active use the focus to add the orange background, so that when the user clicks the button it will turn orange but when it is not focused it will go back to the original colour
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