Decrement the value of a slider control by "10":
document.getElementById("myRange").stepDown(10);
Click the button to decrement the value of the slider control by "10" (each time you click).
<!DOCTYPE html> <html> <body> Points: <input type="range" id="myRange" value="60"> <button onclick="myFunction()">Test</button> <script> function myFunction() {//from w w w. j av a 2s .c om document.getElementById("myRange").stepDown(10); } </script> </body> </html>
The stepDown()
method decrements the value of the slider control by a specified number.
To increment the value, use the stepUp()
method.
stepDown(number);
Parameter Values
Parameter | Description |
---|---|
number | Required. Set the amount the value of the slider control should decrease. If omitted, the value is decremented by "1" |