Javascript DOM HTML Meter min Property set

Introduction

Change the value of the min attribute in a gauge:

document.getElementById("myMeter").min = "20";

Click the button to change the value of the min attribute of the gauge.

View in separate window

<!DOCTYPE html>
<html>
<body>

<p>My scale: <meter id="myMeter" min="0" low="40" high="75" max="100" value="65"></meter></p>
<button onclick="myFunction()">Test</button>

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

<script>
function myFunction() {//from   ww  w . j  av  a2  s .com
  document.getElementById("myMeter").min = "20";
  document.getElementById("demo").innerHTML = "The value of the min attribute was changed.";
}
</script>

</body>
</html>

The min property sets or gets the value of the min attribute in a gauge.

The min attribute specifies the lower bound of the gauge.

The value must be less than the max attribute value.

If unspecified, the default value is 0.

The min property accepts and returns a number type value.




PreviousNext

Related