Meter optimum Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Meter

Description

The optimum property sets or gets the optimum attribute in a gauge, which is the value considered to be an optimal value.

Set the optimum property with the following Values

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

Return Value

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

The following code shows how to return 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() {/*from   w w w  . j av  a2  s.c o  m*/
    var v = document.getElementById("myMeter").optimum;
    document.getElementById("demo").innerHTML = v;
}
</script>
</body>
</html>

Related Tutorials