Javascript DOM HTML Meter max Property get

Introduction

Return the value of the max attribute in a gauge:

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

Click the button to return the value of the max attribute of the gauge above.

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() {//  w w w. j  ava2  s . c  o m
  var x = document.getElementById("myMeter").max;
  document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>



PreviousNext

Related