Input Range disabled attribute
Definition and Usage
disabled
Set or return whether the slider control should be disabled.
Disabled elements are not available and cannot be clicked. By default, disabled elements are usually displayed in gray in the browser.
This property reflects the HTML disabled attribute.
See also:
HTML Reference Manual:HTML <input> disabled Attribute
Example
Example 1
Disable the slider control:
document.getElementById("myRange").disabled = true;
Example 2
Check if the slider control is disabled:
var x = document.getElementById("myRange").disabled;
Example 3
Disable and enable the slider control:
function disableBtn() { document.getElementById("myRange").disabled = true; } function undisableBtn() { document.getElementById("myRange").disabled = false; }
Syntax
Return the disabled attribute:
rangeObject.disabled
Set the disabled attribute:
rangeObject.disabled = true|false
attribute value
value | description |
---|---|
true|false |
Specifies whether the slider control should be disabled.
|
Technical Details
Return value: | Boolean value, returned if the slider control is disabled true ; otherwise return false . |
---|
Browser Support
The numbers in the table indicate the first browser version that fully supports this attribute.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | 10.0 | Support | Support | Support |