Skip to content
Related Articles

Related Articles

HTML | DOM Meter min Property

Improve Article
Save Article
  • Difficulty Level : Basic
  • Last Updated : 23 Aug, 2022
Improve Article
Save Article

The DOM Meter min Property is used to set or return the value of the min attribute in a gauge. The min attribute is used to specify the lower bound of the gauge, The value of min attribute must be less than the value of the max attribute. It has a default value which is 0. 

Syntax: 

  • It returns the min property.
meterObject.min
  • It is used to set the min property.
meterObject.min = number

Property Values: It contains the value i.e number that specify the floating point number that represents the minimum value of the gauge. 

Return Value: It returns a numeric value which represents the minimum value of the gauge. 

Example-1: This Example returns the min Property

HTML




<!DOCTYPE html>
<html>
<head>
    <title>
      DOM Meter min Property
      </title>
</head>
<body>
    <h1>GeeksforGeeks</h1>
    <h2>DOM Meter min Property:</h2> Sachin's score:
    <!-- assigning id to meter with
        properties. -->
    <meter value="5"
           min="0"
           max="10">
        5 out of 10
    </meter>
    <br>Laxma score:
    <!-- meter tag using value property. -->
    <meter id="GFG"
           min="20"
           low="40"
           high="65"
           max="100"
           value="55">
      </meter>
    <br>
    <button onclick="Geeks()">
        Submit
    </button>
    <p id="sudo"
       style="font-size:25px;
              color:green;">
      </p>
    <script>
        function Geeks() {
 
            // return meter min property
            var g =
                document.getElementById("GFG").min;
            document.getElementById("sudo").innerHTML =
              g;
        }
    </script>
</body>
</html>

Output: 

Before Clicking On Button:

  

After Clicking On Button:

  

Example-2: This Example returns a min Property

HTML




<!DOCTYPE html>
<html>
<head>
    <title>
      DOM Meter min Property
      </title>
</head>
<body>
    <h1>
      GeeksforGeeks
      </h1>
    <h2>
      DOM Meter min Property:
      </h2> Sachin's score:
    <!-- assigning id to meter with
        properties. -->
    <meter value="5"
           min="0"
           max="10">
        5 out of 10
    </meter>
    <br>Laxma score:
    <!-- meter tag using value property. -->
    <meter id="GFG"
           min="20"
           low="40"
           high="65"
           max="100"
           value="55">
      </meter>
    <br>
    <button onclick="Geeks()">
        Submit
    </button>
    <p id="sudo"
       style="font-size:25px;
              color:green;">
      </p>
    <script>
        function Geeks() {
 
            // set meter min property
            var g =
                document.getElementById("GFG").min =
                "10";
            document.getElementById("sudo").innerHTML =
              "The value of the min attribute was changed to "
            + g;
        }
    </script>
</body>
</html>

Output : 

Before Clicking On Button:

  

After Clicking On Button:

  

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

  • Chrome 6
  • Firefox 16
  • Edge 18
  • Safari 6
  • Opera 11

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!