Meter min Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Meter

Description

The min property sets or gets the min attribute in a gauge, which controls the lower bound of the gauge.

Set the min property with the following Values

Value Description
number Sets a floating point number that is the minimum value of the gauge. Default value is "0"

Return Value

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

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

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

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

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

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

<script>
function myFunction() {/*w  w  w . j a  v  a2s .c  o  m*/
    document.getElementById("myMeter").min = "20";
    document.getElementById("demo").innerHTML = "The value of the min attribute was changed from '0' to '20'.";
}
</script>
</body>
</html>

Related Tutorials