Adding ratings (HTML)
The Rating control let users rate something by clicking an icon that represents a rating. It can display three types of ratings: an average rating, a tentative rating, and the user's rating. (Windows only)
- Average rating
Displays the average rating as calculated or stored by your app.
The control doesn’t store user ratings or calculate the average, so you must save the ratings to your server or local storage and calculate the average. The control accepts floating point values and can show partial stars.
- Tentative rating
When the user interacts with the control, by mouse hover, keyboard focus, mouse down, mouse drag, touch down, or touch drag, the control displays a preview of the new rating. After a moment, it also displays a tooltip with a description or value of the new rating.
- User rating
The rating selected by the user.
By default, the control lets users clear their previous ratings by sliding their fingers or the mouse pointer from the right to the left side of the control and lifting. Users can also use the arrow key to empty all the stars and then press Enter, or press 0 and then Enter.
The topics in this section show you how to use the Rating control in your app.