Meter value Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Meter

Description

The value property sets or gets the value attribute in a gauge.

Set the value property with the following Values

Value Description
number Sets a floating point number that is the current value of the gauge

Return Value

A Number, representing a floating point number that is the current value of the gauge

The following code shows how to change the value of the value attribute in a gauge:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<meter id="myMeter" min="0" low="40" high="95" max="100" value="65"></meter>

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

<script>
function myFunction() {/* ww w.j  a v a2  s. co m*/
    document.getElementById("myMeter").value = "50";
    document.getElementById("demo").innerHTML = "The value of the value attribute was changed from '65' to '50'.";
}
</script>
</body>
</html>

Related Tutorials