HTML DOM Meter min Property
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 >w3wiki</ 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 = "myBeginner()" > Click Here! </ button > < p id = "result" ></ p > < script > function myBeginner() { 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 >w3wiki</ 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 = "myBeginner()" > Click Here! </ button > < p id = "result" ></ p > < script > function myBeginner() { let minVal = document.getElementById("GFG").min = "10"; document.getElementById("result").innerHTML = "Value of min Attribute changed to " + minVal; } </ script > </ body > </ html > |
Output:
Supported Browsers:
- Chrome 6
- Firefox 16
- Edge 18
- Safari 6
- Opera 11