Forms & Controls

HTML <meter> element

Build a form with the HTML form generator

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

NameTypeDescription
valuenumberRequired measured value between min and max.
minnumber or type-specific date/timeSets 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.
maxnumber or type-specific date/timeSets 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.
lowfloating-point numberSets a meter's low threshold within the minimum and maximum range. Together with high and optimum it classifies the displayed measurement.
highfloating-point numberDefines the high threshold of a meter, between its low and maximum values. It is a classification boundary, not a maximum constraint.
optimumfloating-point numberIndicates 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>
HTML Reference