Latest web development tutorials

HTML DOM Input Range disabled property

Input Range Object Reference Input Range Object

Examples

Disable slider control:

document.getElementById("myRange").disabled = true;

Output:


try it"

Definition and Usage

disabled property sets or returns whether the slider control is disabled.

Use the disabled attribute elements are not available and can not be clicked. Disabled elements are usually displayed on the browser gray.

This property reflects the HTML disabled property.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the disabled attribute.

Note: Internet Explorer 9 and earlier versions of IE do not support the use of type = HTML <input> element "range" attribute.


grammar

Returns disabled properties:

rangeObject .disabled

Set the disabled attribute:

rangeObject .disabled=true|false

Property Value

描述
true|false 描述滑块控件是否可用。
  • true - 滑块控件不可用
  • false -默认。 滑块控件可用

technical details

return value: Boolean control is not available if the slider returns true, false otherwise


More examples

Examples

See if the slider controls are available:

var x = document.getElementById("myRange").disabled;
x The output is:
true

try it"

Examples

Disable or enable slider controls:

function disableBtn() {
document.getElementById("myRange").disabled = true;
}
function undisableBtn() {
document.getElementById("myRange").disabled = false;
}

try it"


Related Pages

HTML Reference Manual: HTML <the INPUT> Disabled Property


Input Range Object Reference Input Range Object