Get Meter Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Meter

Introduction

The Meter object represents an HTML <meter> element.

You can access a <meter> element by using getElementById():

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

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

<button onclick="myFunction()">get the current, "measured" value of the gauge above</button>

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

<script>
function myFunction() {/*from   w w  w .j a v a  2s.c o m*/
    var x = document.getElementById("myMeter").value;
    document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>

Related Tutorials