The HTML <meter> tag is used to display a scalar measurement within a known range. It is commonly used to show values like disk usage, scores, or battery levels.
- Represents a value within a predefined minimum and maximum range.
- Commonly used for progress indicators like battery status or performance levels.
- Supports attributes such as min, max, value, low, high, and optimum.
Syntax:
<meter attributes...> </meter>Attributes
- form Attribute: form defines one or more forms to which the <meter> tag belongs.
- max Attribute: max specifies the maximum value of the range.
- min Attribute: min specifies the minimum value of the range.
- high Attribute: high specifies the range considered as a high value.
- low Attribute: low specifies the range considered as a low value.
- optimum Attribute: optimum specifies the optimum value for the range.
- value Attribute: value specifies the current or actual value of the range.
Note: It's highly recommended to incorporate the <label> tag for optimal accessibility practices
Example: In this example, we will see the implementation of the meter tag with an example.
<!--Driver Code Starts-->
<!DOCTYPE html>
<html>
<body>
<h1>
GeeksforGeeks
</h1>
<p>
Meter Tag:
</p>
Sachin's score:
<!--Driver Code Ends-->
<meter value="5" min="0" max="10">
5 out of 10
</meter>
<br>
Laxma sxore:
<meter value="0.5">
50% from 100%
</meter>
<!--Driver Code Starts-->
</body>
</html>
<!--Driver Code Ends-->