Open In App

HTML DOM Meter min Property

Last Updated : 29 Jan, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

The DOM Meter min Property is used to set or return the value of the min attribute in a gauge. The min attribute specify the lower bound of the gauge. The value of the 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>
        HTML DOM Meter min Property
    </title>
</head>
 
<body style="text-align: center;">
    <h1>GeeksforGeeks</h1>
 
    <h2>HTML DOM Meter min Property</h2>
     
    <label>Sachin's Score:</label>
    <meter id="GFG" min="20" low="40"
        high="65" max="100" value="55">
    </meter><br><br>
 
    <button onclick="myGeeks()">
        Click Here!
    </button>
 
    <p id="result"></p>
 
    <script>
        function myGeeks() {
            let minVal = document.getElementById("GFG").min;
            document.getElementById("result").innerHTML = minVal;
        }
    </script>
</body>
 
</html>


Output:

meter-min

Example 2: This example returns a min property. 

HTML




<!DOCTYPE html>
<html>
 
<head>
    <title>
        HTML DOM Meter min Property
    </title>
</head>
 
<body style="text-align: center;">
    <h1>GeeksforGeeks</h1>
 
    <h2>HTML DOM Meter min Property</h2>
     
    <label>Sachin's Score</label>
 
    <meter id="GFG" min="20" max="100" value="55">
    </meter><br><br>
 
    <button onclick="myGeeks()">
        Click Here!
    </button>
 
    <p id="result"></p>
 
    <script>
        function myGeeks() {
            let minVal = document.getElementById("GFG").min = "10";
 
            document.getElementById("result").innerHTML =
                "Value of min Attribute changed to " + minVal;
        }
    </script>
</body>
 
</html>


Output: 

meter-min-2

Supported Browsers:

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


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads