Meter optimum Property - Change the value of the optimum attribute in a gauge: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Meter

Description

Meter optimum Property - Change the value of the optimum attribute in a gauge:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<meter id="myMeter" value="0.3" high="0.9" low="0.1" optimum="0.5"></meter>

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

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

<script>
function myFunction() {/*ww w  .  ja va2 s .co  m*/
    document.getElementById("myMeter").optimum = "0.7";
    document.getElementById("demo").innerHTML = "The value of the optimum attribute was changed from '0.5' to '0.7'.";
}
</script>
</body>
</html>

Related Tutorials