Change the value of a slider control:
The value property sets or returns the value of the value attribute of a slider control.
The value attribute specifies the default value OR the value a user types in (or a value set by a script).
The value property is supported in all major browsers.
Note: The <input type="range"> element is not supported in Internet Explorer 9 and earlier versions.
Return the value property:
Set the value property:
Value | Description |
---|---|
number | Specifies the value of the slider control. If the value is not specified, the default value is "50" |
Return Value: | A String, representing a number that represents the value of the slider control |
---|
Get the value of a slider control:
The result of x will be:
An example that shows the difference between the defaultValue and value property:
HTML reference: HTML <input> value attribute