THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

Input Color disabled Property

Input Color Object Reference Input Color Object

Example

Disable a color picker:

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

The result will be:

Try it yourself »

Definition and Usage

The disabled property sets or returns whether a color picker should be disabled, or not.

A disabled element is unusable and un-clickable. Disabled elements are usually rendered in gray by default in browsers.

This property reflects the HTML disabled attribute.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The disabled property is supported in all major browsers.

Note: The <input type="color"> element is not supported in Internet Explorer and Safari.


Syntax

Return the disabled property:

colorObject.disabled

Set the disabled property:

colorObject.disabled=true|false

Property Values

Value Description
true|false Specifies whether a color picker should be disabled or not
  • true - The color picker is disabled
  • false - Default. The color picker is not disabled

Technical Details

Return Value: A Boolean, returns true if the color picker is disabled, otherwise it returns false

More Examples

Example

Find out if a color picker is disabled or not:

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

The result of x will be:

true
Try it yourself »

Example

Disable and undisable a color picker:

function disableBtn() {
    document.getElementById("myColor").disabled = true;
}
function undisableBtn() {
    document.getElementById("myColor").disabled = false;
}
Try it yourself »

Related Pages

HTML reference: HTML <input> disabled attribute


Input Color Object Reference Input Color Object