YouTip LogoYouTip

Prop Range Disabled

HTML DOM Input Range disabled Property

HTML DOM Input Range disabled Property

-- Learning is not just about technology, but also about dreams!

JavaScript Reference Manual

Overview

JavaScript Objects

Browser Objects

DOM Objects

HTML Objects

<input> - number

HTML DOM Password Object

Input Range disabled Property

Input Range Object Reference Manual Input Range Object

Example

Disable the slider control:

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

Output:

Try it yourself Β»


Definition and Usage

The disabled property is used to set or return whether the slider control is disabled.

An element with the disabled attribute is unusable and unclickable. Disabled elements are usually rendered in gray in the browser.

This property reflects the HTML disabled attribute.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the disabled property.

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


Syntax

Get the disabled property:

_rangeObject_.disabled

Set the disabled property:

_rangeObject_.disabled=true|false

Property Values

Value Description
true|false Specifies whether the slider control is available.
* true - The slider control is not available.
* false - Default. The slider control is available.

Technical Details

Return Value: A Boolean. Returns true if the slider control is not available, otherwise returns false.

More Examples

Example

Check if the slider control is available:

var x = document.getElementById("myRange").disabled;

x output will be:

true

Try it yourself Β»

Example

Disable or enable the slider control:

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

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

Try it yourself Β»


Related Pages

HTML Reference Manual: HTML <input> disabled Attribute


Input Range Object Reference Manual Input Range Object

<input> - number

HTML DOM Password Object

← Prop Range FormProp Range Autofocus β†’