The min
attribute from the meter element
specifies the lower bound of the gauge, and the value must be less than the max attribute value.
The default min value is 0.
The min
property sets or gets the min attribute in a gauge.
Meter min |
Yes | No | Yes | Yes | Yes |
Return the min property.
var v = meterObject.min
Set the min property.
meterObject.min=number
Value | Description |
---|---|
number | Set the minimum value of the gauge. Default value is 0. |
A Number type value representing the minimum value of the gauge.
The following code shows how to get the max attribute in a gauge.
<!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>
<!--from w ww. j a v a 2 s . com-->
<script>
function myFunction() {
var x = document.getElementById("myMeter").min;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>
The code above is rendered as follows:
The following code shows how to change the min attribute in a gauge.
<!DOCTYPE html>
<html>
<body>
<meter id="myMeter" min="0" low="40" high="75" max="100" value="65"></meter>
<button onclick="myFunction()">test</button>
<script>
function myFunction() {<!-- w ww .j a v a 2 s .c o m-->
document.getElementById("myMeter").min = "20";
}
</script>
</body>
</html>
The code above is rendered as follows: