Jack• 490
@Jack-WebDev
Submitted
My JavaScript is not working. Please help me fix it.
Looking to hire developers?
@gideon-del
@Jack-WebDev
Submitted
My JavaScript is not working. Please help me fix it.
@gideon-del
Posted
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