Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / HTML

optimum — preferred gauge value

The optimum attribute on meter identifies a preferred value and, together with low and high, determines the optimal region.

Version: WHATWG HTML Living Standard; index snapshot date recorded separately

Syntax

<meter min="0" max="100" low="30" high="70" optimum="80" value="75">75/100</meter>

optimum belongs to meter, not its current measurement value. It requires a valid floating-point number between min and max. Below low it favors the lower region; above high, the upper region; between them, including either boundary, the middle region.

An absent or unparseable value defaults to the range midpoint. Browsers clamp the interpreted value to the range; this does not excuse invalid markup. The meter.optimum property returns the computed optimum point.

Examples

<!doctype html>
<meta charset="utf-8">
<title>optimum</title>
<label for="score">Score</label>
<meter id="score" min="0" max="100" low="30" high="70" optimum="80" value="75">75/100</meter>
<pre id="result"></pre>
<script>
  const meter = document.getElementById('score');
  document.getElementById('result').textContent = String(meter.optimum);
</script>

Result

80

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources