HTML value Attribute


The value attribute of the <meter> element specifies the current value of the gauge. This is a required attribute.

Following is the syntax −

<meter value="num">

Above, num represents the current value as a floating-point number.

Let us now see an example to implement the value attribute of the <meter> element −

Example

 Live Demo

<!DOCTYPE html>
<html>
<body>
   <h2>Result</h2>
   <p>Girls pass % <meter min="0" low="0" high="100" max="100" value="80"></meter></p>
   <p>Boys pass %<meter min="0" low="0" high="100" max="100" value="70"></meter></p>
</body>
</html>

Output

In the above example, we have set the pass percentage of girls as well as boys using the <meter> element. The current value is set using the value attribute −

Boys pass %<meter min="0" low="0" high="100" max="100" value="70"></meter>

Updated on: 29-Jun-2020

86 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements