Easy Tutorial
❮ Prop Document Documenturi Jsref E ❯

Input Week disabled Attribute

Input Week Object

Example

Disable the week field:

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

Output result:


Definition and Usage

The disabled attribute is used to set or return whether the week field is disabled.

Elements with the disabled attribute are unusable and unclickable. Disabled elements are typically displayed as grayed out in the browser.

This attribute reflects the HTML disabled attribute.


Browser Support

All major browsers support the disabled attribute.

Note: The <input type="week"> element is not supported in Internet Explorer or Firefox.


Syntax

Return the disabled attribute:

Set the disabled attribute:

Attribute Values

Value Description
true false Describes whether the week field is usable. true - The week field is not usable. false - Default. The week field is usable.

Technical Details

| Return Value: | Boolean, returns true if the week field is not usable, otherwise returns false | | --- | --- |


More Examples

Example

Check if the week field is usable:

var x = document.getElementById("myWeek").disabled;
true

Example

Disable or enable the week field:

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

Related Pages

HTML Reference: HTML <input> disabled Attribute


❮ Prop Document Documenturi Jsref E ❯