optimum
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
<meter optimum="number">
Example
<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.
open
The HTML open attribute is a Boolean attribute for the <details> element, ensuring its content is visible when the page loads.
selected
The selected attribute in HTML designates a default option in a <select> dropdown, improving user experience by automatically choosing a frequently selected item.