Adriano• 33,970
@AdrianoEscarabote
Posted
Hello KareemRamadan840, how are you? Welcome to the community of front-end mentors! I truly loved your project's outcome, however I have some advice that I hope you'll find useful:
To make the submit button work only when the user selects a number, we can make some changes:
ratingNumber.forEach((ele, i) =>
ele.addEventListener("click", function () {
let active = document.querySelector(".active");
active ? active.classList.remove("active") : "";
ele.classList.add("active");
yourRating.innerHTML = `You select ${i + 1} out of 5`;
submit.addEventListener("click", function () {
thanks.classList.remove("hidden");
main.classList.add("hidden");
});
})
);
The remainder is excellent.
I hope it's useful. 👍
Marked as helpful
0
Kareem Elshafee• 120
@KareemRamadan840
Posted
@AdrianoEscarabote Thank you Adriano I appreciate your feedback
1