Rate with Stars

Write the code, see it run, pass the checks.

The problem

  • easy
  • Code

Show five star buttons labelled (with aria-label) "1 star", "2 stars", "3 stars", "4 stars" and "5 stars", and a line reading "Not rated yet". Clicking a star sets the rating: the line reads "Rated 3 of 5", and every star up to the rating is pressed (aria-pressed="true"). Clicking the current rating again clears it.

Your code must pass

  • It starts not rated
  • Clicking 3 stars shows Rated 3 of 5
  • Stars up to the rating are pressed
  • Clicking the same rating again clears it