GO-Ve01
ServicesDevelopersBooksDictionaryPapersWikidataEncyclopediaSearchBabelCareersDeck

HTMLMeterElement: value property

HTML DOM

HTML DOM

The **`value`** property of the HTMLMeterElement interface represents the current value of the meter element as a floating-point number. It reflects the element's [`value`](/docs/Web/HTML/Reference/Elements/meter#value) attribute. If no `value` is set, it is the HTMLMeterElement.min value or `0`, whichever is greater.

This property can also be set directly, for example to set a default value based on some condition.

## Value

A number. Defaults to either HTMLMeterElement.min or `0`, whichever if greater, if not defined.

## Examples

```html
<label for="fuel">Current fuel level:</label>
<meter
id="fuel"
min="0"
max="100"
low="15"
high="66"
optimum="80"
value="50"></meter>
```

```js
const meterElement = document.getElementById("fuel");
console.log(meterElement.value); // 50
--meterElement.value;
console.log(meterElement.value); // 49
```

## Specifications

## Browser compatibility

## See also

- meter
- HTMLMeterElement.min
- HTMLProgressElement

source: MDN Web Docs mirror · page

Cite this

"HTMLMeterElement: value property". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/HTMLMeterElement/value

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·