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 w/ JS

Sam King 50

@samhlking

Desktop design screenshot for the Interactive rating component coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


What are you most proud of, and what would you do differently next time?

Proud of turning a list of radio inputs into 'buttons' that returned their assigned values to be used in the JS function.

What specific areas of your project would you like help with?

As my first JavaScript project, I'd love any feedback on my script. Is there a more efficient/better way to do what this project requires?

Also, I made the form 'required' with an if statement within the function

if (radios !== null) {
        formStart.style.display = "none";
        formFinish.style.display = "block";
        selectedMessage.innerText = `You selected ${radios} out of 5`
    }

As the button on the form isn't a submit button, I believe the normal method of adding 'required' to the HTML inputs wouldn't work. Is my workaround ok or once again is there a better way?

Community feedback

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