optimum

The HTML optimum attribute indicates the preferred value for a <meter> element, helping to convey the significance of measured values.

optimum attribute

The optimum attribute in HTML is used with the <meter> tag to define the ideal value within a specific range, helping users understand the meter's value and whether it's within an optimal, suboptimal, or critical range.

Syntax

index.html
<meter optimum="number">

Example

Example of optimum attribute
Your progress is at 70%. Your progress is at 90%. You've reached the optimal level of 100%.
index.html
<h2>Example of optimum attribute</h2>
<meter min="0" max="100" value="70" optimum="80">
  Your progress is at 70%. 
</meter>
<meter min="0" max="100" value="90" optimum="80">
  Your progress is at 90%. 
</meter>
<meter min="0" max="100" value="100" optimum="80">
  You've reached the optimal level of 100%.
</meter>

Definition and Usage

The optimum attribute defines the range in which the gauge's value is regarded as optimal.

Values

  • number
    • A whole or floating point number.

Applies To

The optimum attribute can be used on the following html elements.

Conclusion

The optimum attribute in HTML sets the ideal value for a <meter> element, highlighting the optimal range for the measurement. It helps users understand whether the value falls within the preferred range. This attribute is particularly useful for displaying progress or performance, indicating when a goal is met.