Input Range value Property
Example
Modify the value of the slider control:
document.getElementById("myRange").value = "75";
Try it »
Definition and Usage
The value property sets or returns the value of the value attribute of the slider control.
The value attribute describes the value entered by the user, the default value, or the value entered by a script.
Browser support





All major browsers support the value attribute.
Note: Internet Explorer 9 and earlier versions do not support the HTML using the type="range" attribute .
Syntax
Return the value attribute:
rangeObject
.value
Set the value attribute:
rangeObject
.value=
number
Attribute values
| Value | Description |
|---|---|
| number | Describes the initial (default) value of the slider control. If not specified, the default value is "50" |
Technical Details
| Return Value: | A string representing a number |
|---|
More examples
Example
Get the value of the slider control:
var x = document.getElementById("myRange").value;
x
The output is:
50
Try it »
Related pages
HTML Reference Manual: HTML value attribute
Input Range Object