The min
property sets or gets the min attribute of a slider control.
The min
attribute specifies the minimum value for a slider control.
min |
Yes | 10 | Yes | Yes | Yes |
Return the min property.
var v = rangeObject.min
Set the min property.
rangeObject.min=number
Value | Description |
---|---|
number | Set the minimum value allowed for the slider control |
A String type value representing the minimum value allowed.
The following code shows how to change the minimum value.
<!DOCTYPE html>
<html>
<body>
<!-- w w w.j a v a 2s.c om-->
Points: <input type="range" id="myRange" min="25" max="75">
<button onclick="myFunction()">test</button>
<script>
function myFunction() {
var x = document.getElementById("myRange").min = "50";
}
</script>
</body>
</html>
The code above is rendered as follows:
The following code shows how to get the minimum value allowed for a slider control.
<!DOCTYPE html>
<html>
<body>
Points: <input type="range" id="myRange" min="25" max="75">
<button onclick="myFunction()">test</button>
<!--from w w w.j av a2 s . c o m-->
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myRange").min;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>
The code above is rendered as follows: