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

Gloryjaw 320

@Gloryjaw

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


First time using JavaScript in a project. All feed-backs are appreciated. Thank You.

Community feedback

David 8,000

@DavidMorgade

Posted

Hello Gloryjaw, congratulations on finishing the challenge! as a first Javascript project you did a pretty good job!

The only little problem that I find with your App is that you can still submit the ratings even when no rating is selected, you can fix this by adding a condition in your function that checks if a rating was selected, try something like this (not tested):


submit.addEventListener('click', function () {
    if(rating === 0) return alert('Select a rating before submitting!')
    thankyoustate.style.display = "block"
    ratingstate.style.display = "none"
    variablerating.innerText = `You selected ${rating} out of 5`
})

This will display a simple alert popup if no rating was selected! and will stop the function from working.

Hope my feedback helps you! if you have any question or if this doesn't work in your code, don't hesitate to ask, good job!

Marked as helpful

3

Gloryjaw 320

@Gloryjaw

Posted

@DavidMorgade Thank you, I have updated my solution.

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