Forms & Controls
HTML <meter> element
Displays a scalar measurement in a known range. Use progress for task completion rather than a gauge such as capacity or score. Use meter for a scalar measurement with a known range, not for task progress. Provide an accessible label; thresholds describe meaningful ranges rather than enforce user-input constraints. It accepts global HTML attributes; individual global features may be inapplicable or restricted.
Formal Syntax & Structure
html syntaxhtml
<meter min="0" max="100" value="70">70%</meter>Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| value | number | Required measured value between min and max. |
| min | number or type-specific date/time | Sets the lower constraint for eligible inputs or the lower bound of meter. It must use the type's value syntax; the effect depends on the element. |
| max | number or type-specific date/time | Sets the upper constraint for applicable input types or the upper bound for meter and progress. Format and defaults depend on the element and input type. |
| low | floating-point number | Sets a meter's low threshold within the minimum and maximum range. Together with high and optimum it classifies the displayed measurement. |
| high | floating-point number | Defines the high threshold of a meter, between its low and maximum values. It is a classification boundary, not a maximum constraint. |
| optimum | floating-point number | Indicates the preferred measurement in a meter. The location relative to low and high determines which ranges are considered more desirable. |
Return Value
HTMLMeterElement
Content model: Phrasing content, with no nested element of the same kind.
Working Example
Example Snippethtml
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <title>HTML example</title> </head> <body> <label for="storage">Storage used</label> <meter id="storage" min="0" max="100" value="70">70%</meter> </body></html>