Last Updated : 29 Jan, 2024
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:
meterObject.min
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:
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:
Supported Browsers:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4