CodeOath
← All challenges

Star Rating Widget

Easy
javascriptdom

Build a 5-star rating widget. Hovering over a star previews a rating (highlighting that star and every star before it); clicking locks in the rating, which stays highlighted after the mouse leaves.

Check your work against

  • 5 stars are rendered
  • Hovering highlights the hovered star and every star before it
  • Moving the mouse away without clicking reverts to the last clicked rating (or empty if none yet)
  • Clicking locks in that rating even after the mouse leaves

There's no automated grading for UI challenges — self-check against this list, then compare with the solution preview.

Live preview