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

rating page

Andy Cole 10

@Thiha007

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


It pretty easy.

Community feedback

@KrishangSharma

Posted

Hello there! There a few things I'd like to point out by looking at your code, 1). You're doing things in kind of a messy way. What I mean is, there is an easier way to do what is asked. Rather than targeting each rating number individually, I'd recommend giving them all a common class name and then using 'document.querySelectorAll' and then loop over the buttons for retrieving the number. The loop itself is a bit tough just because you chose to add an array in between, while actually it was not needed at all.

2). For the Thank you part, I'd rather add it in the HTML itself and then hide it using CSS, and then upon clicking the submit btn, I'd toggle the classes between the two cards, this way you won't need to code the HTML in your JS file. For the places where you need the value from JS, you can leave them empty, then target them in your JS file, and then populate them with 'innerHTML'

If it all seems a bit complex, you can have a look at my solution :)

Hope this helps!

Marked as helpful

0

Andy Cole 10

@Thiha007

Posted

@KrishangSharma Thanks. That's really helpful.

0

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