HTML DOM Input Color disabled property
Examples
D Disable Color Picker:
document.getElementById("myColor").disabled = true;
Output:
try it"
Definition and Usage
disabled property sets or returns the color picker is available.
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
All major browsers support the disabled attribute.
Note: Internet Explorer and Safari browsers do not support the <input type = "color"> element.
grammar
Returns disabled properties:
colorObject .disabled
Set the disabled attribute:
colorObject .disabled=true|false
Property Value
值 | 描述 |
---|---|
true|false |
描述了拾色器是否可用
|
technical details
return value: | Boolean value that, if the color picker is disabled returns true, otherwise returns false. |
---|
More examples
Examples
See Color Picker is available:
var x = document.getElementById("myColor").disabled;
x The output is: true
try it"
Examples
Disable or enable the Color Picker:
function disableBtn() {
document.getElementById("myColor").disabled = true;
}
function undisableBtn() {
document.getElementById("myColor").disabled = false;
}
document.getElementById("myColor").disabled = true;
}
function undisableBtn() {
document.getElementById("myColor").disabled = false;
}
try it"
related articles
HTML Reference Manual: HTML <the INPUT> Disabled Property
Input Color Object