HTML optimum attribute

optimum attribute gives the optimum value in meter element.

<!--if the value falls above the high value, then the color of bar changes--->
 <p>Cary's weight: <meter min=0 max=150 value=70 title=kilogram high=78>100</meter></p>
 <p>Cary's weight: <meter min=0 max=150 value=100 title=kilogram high=78 optimum=90>100</meter></p>

Cary's weight: 100

Cary's weight: 100

Attribute values

All possible values of optimum attribute

The value of this attribute is a valid floating point number.

  • If the optimum value is higher than the high value, then higher the value the better it will be.

  • If the optimum value is less than the low value, then lower the value the better it will be.

  • It the optimum value is in between the low and the high values, then middle values are good.

  • As in the above example, the optimum value is greater than high. All values that are greater than 78 are optimum.

Related Tags

The tags that support optimum attribute

<meter> tag

meter represents the completion of a task in the form of a bar for known range value. For instance, the progress of a battery being charged.

Was this article helpful?