HTML <meter> Element
The <meter> tag defines a scalar measurement within a known range. This can be used to display a visual representation of a value within a specified range. It is often used in displaying progress bars, gauges, and other visual representations of measurements.
Example:
<meter value="60" min="0" max="100">60 out of 100</meter>
In the above example, the <meter> tag is used to display a measurement of 60 out of 100 within a range of 0 to 100.
Attributes of the <meter> tag:
| Attribute | Description |
|---|---|
| value | Sets the current value of the measurement. |
| min | Specifies the minimum value of the measurement range. |
| max | Specifies the maximum value of the measurement range. |
| low | Specifies a range below which the value is considered low. |
| high | Specifies a range above which the value is considered high. |
Example with Attributes:
<meter value="40" min="0" max="100" low="30" high="70" optimum="80">40 out of 100</meter>
In this example, the <meter> tag has additional attributes low, high, and optimum specified. The value of 40 is considered within a low range of 30-70, and an optimum value of 80 is set.