Increment the value of a slider control by "10":
document.getElementById("myRange").stepUp(10);
Click the button to increment 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() {/* ww w . jav a 2s . c o m*/ document.getElementById("myRange").stepUp(10); } </script> </body> </html>
The stepUp()
method increments the value of the slider control by a specified number.
To decrement the value, use the stepDown()
method.
stepUp(number);
Parameter Values
Parameter | Description |
---|---|
number | Required. Set the amount the value of the slider control should increase. If omitted, the value is incremented by "1". |