Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

interactive-rating-component-main

@KareemRamadan840

Desktop design screenshot for the Interactive rating component coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Community feedback

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

@KareemRamadan840

Posted

@AdrianoEscarabote Thank you Adriano I appreciate your feedback

1

Please log in to post a comment

Log in with GitHub
Discord logo

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