Open In App
Related Articles

HTML | DOM meter Object

Improve Article
Save Article
Like Article

The DOM Meter Object is used to represent the HTML <meter> element. The meter element is accessed by getElementById().

  • form: It belongs to one or more forms that it belongs too.
  • max: It is used to specify the maximum value of a range.
  • min: It is used to specify the minimum value of a range.
  • high: It is used to specify the range considered to be a high value.
  • low: It is used to specify the range value that is considered to be low.
  • Optimum: It is used to specify the optimum value for the range.
  • value: It is used to specify the required or actual value of the range.
  • labels: It is used to return a list of <label> element that has been labeled for the gauge. 



Where “id” is the ID assigned to the “meter” tag.


<!DOCTYPE html>
    <title>DOM Meter Object</title>
    <h2>DOM Meter Object:</h2> Sachin's score:
    <!-- assigning id to meter with
         properties. -->
    <meter id="GFG"
      5 out of 10
    <br>Laxma score:
    <!-- meter tag using value property. -->
    <meter value="0.5">50% from 100% </meter>
    <button onclick="Geeks()">
    <p id="sudo"></p>
        function Geeks() {
            //  Accessing 'meter' tag.
            var g =
            document.getElementById("sudo").innerHTML = g;

Before Clicking On Button : 

After Clicking On Button: 

Example-2: Meter Object can be created by using the document.createElement method. 


<!DOCTYPE html>
    <title>DOM Meter Object</title>
        body {
            font-size: 20px;
<body style="text-align:center;">
        <h1 style="color:green">GeeksforGeeks</h1>
        <h2>DOM Meter Object</h2>
        <p id="GFG">Sachins score:</p>
    <button onclick="myGeeks()">Submit</button>
        function myGeeks() {
            //  Creating meter object using
            //  document.createElement.
            var g = document.createElement("METER");
            g.setAttribute("min", "0");
            g.setAttribute("max", "10");
            g.setAttribute("value", "5");

Before Clicking On Button: 

After Clicking On Button: 

Supported Browsers: The browser supported by DOM Meter Object are listed below: 

  • Google Chrome
  • Firefox
  • Opera
  • Safari


Last Updated : 22 May, 2022
Like Article
Save Article
Similar Reads
Related Tutorials