Return the value of the optimum attribute in a gauge:
var x = document.getElementById("myMeter").optimum;
Click the button to return the value of the optimum attribute of the gauge.
<!DOCTYPE html> <html> <body> <p>My scale: <meter id="myMeter" value="0.3" high="0.9" low="0.1" optimum="0.5"></meter></p> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*from w ww. ja v a2s .c o m*/ var x = document.getElementById("myMeter").optimum; document.getElementById("demo").innerHTML = x; } </script> </body> </html>
The optimum
property sets or gets the value of the optimum attribute in a gauge.
The optimum attribute sets the range where the gauge's value is considered to be an optimal value.
The optimum
property accepts and returns a number type value.