Javascript DOM HTML Meter min Property get

Introduction

Return the value of the max attribute in a gauge:

var x = document.getElementById("myMeter").min;

Click the button to return 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="95" max="100" value="65"></meter></p>
<button onclick="myFunction()">Test</button>

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

<script>
function myFunction() {//from w w w .jav  a2 s . com
  var x = document.getElementById("myMeter").min;
  document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>



PreviousNext

Related