It is used to define a scalar measure within a known range or fractional value, for example the percentage of use of a hard disk or the fuel level of a vehicle.
It has several attributes:
-
value
specifies the value of the<meter>
and is the only required attribute. It must be betweenmin
andmax
(if they are defined). If it has no value or is incorrectly formatted, its value is 0. If it is specified but not within the range ofmin
andmax
, it takes the value of the closest extreme. -
min
specifies the minimum value it can take. It must be less thanmax
and by default it is 0. -
max
specifies the maximum value it can take. It must be greater thanmin
and by default it is 1. -
low
specifies the value beyond which the metric is considered to have a low value. It must be greater thanmin
and less thanhigh
andmax
. If it is not specified or its value is less thanmin
, it takes the value ofmin
. -
high
specifies the value beyond which the metric is considered to have a high value. It must be less thanmax
and greater thanlow
andmin
. If it is not specified or its value is greater thanmax
, it takes the value ofmax
. -
optimum
specifies the value that is considered optimal for the metric. It must be contained betweenmin
andmax
. The browser can choose to color the bar differently if the value is above or equal to optimal. -
form
specifies the form to which the<meter>
is associated and its value will be theid
of the<form>
that is in the same document. If not specified, the<meter>
will look for a<form>
among its parents to associate with. This attribute should only be used when the<meter>
is used to represent the value of some form field, such as an<input type="number" />
.
Between its opening or closing tags, a text will be put that represents the value that it is showing.
It should be used with an associated tag using for
-id
for better accessibility.
- Type: block
- Self-closing: No
- Semantic value: No
Top comments (0)