Input Week disabled property
Example
Disable the week field:
document.getElementById("myWeek").disabled = true;
Output result:
Try it »
Definition and Usage
The disabled property is used to set or return whether the week field is disabled.
Elements with the disabled attribute are unavailable and not clickable. Disabled elements are usually displayed in gray in the browser.
This attribute reflects the HTML disabled attribute.
Browser support





All major browsers support the disabled property
Note: Internet Explorer or Firefox browsers do not support .
Syntax
Return the disabled attribute:
weekObject
.disabled
Set the disabled attribute:
weekObject
.disabled=true|false
Attribute values
| Value | Description |
|---|---|
| true|false | Describes whether the week field is available.
|
Technical Details
| Return Value: | Boolean, returns true if the week field is unavailable, otherwise returns false |
|---|
More examples
Example
Check whether the week field is available:
var x = document.getElementById("myWeek").disabled;
x
The output is:
true
Try it »
Example
Disable or enable the week field:
function disableBtn() {
document.getElementById("myWeek").disabled = true;
}
function undisableBtn() {
document.getElementById("myWeek").disabled = false;
}
Try it »
Related pages
HTML Reference Manual: HTML disabled attribute
The Input Week object