Javascript examples for DOM HTML Element:Input Range
The value property sets or gets the value attribute of a slider control.
Set the value property with the following Values
Value | Description |
---|---|
number | Sets the value of the slider control. |
A String, representing a number that represents the value of the slider control
The following code shows how to change the value of a slider control:
<!DOCTYPE html> <html> <body> Points: <input type="range" id="myRange" value="20"> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/* ww w. j a va 2 s . c o m*/ document.getElementById("myRange").value = 10; } </script> </body> </html>