@AdrianoEscarabote
Posted
Hello Anubhav Ray, how are you? 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:
for (let i = 0; i < list.length; i++) {
list[i].addEventListener("click", function (event) {
list[i].classList.toggle("clicked");
selectEl = event.target;
submit.addEventListener("click", function () {
document.querySelector(".Rate-Container").classList.add("hidden");
document.querySelector(".ThankYou-Container").classList.remove("hidden");
document.querySelector(".container").classList.add("width");
document.querySelector(".select").textContent = `${selectEl.textContent}`;
});
});
}
The remainder is excellent.
I hope it's useful. ๐
Marked as helpful