Input Week disabledProperty

Input Week 对象参考手册Input Week Object

Examples

Disable the week field:

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

Output:


Try it yourself »

Definition and Usage

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

Elements using the disabled property are unavailable and unclickable. Disabled elements are typically displayed in gray in browsers.

This property reflects the HTML disabled attribute.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the disabled property

Note:Internet Explorer or Firefox browsers do not support the <input type="week"> element.


Syntax

Return the disabled property:

weekObject.disabled

Set the disabled property:

weekObject.disabled=true|false

Property Values

Value Description
true|false Describes whether the week field is available.
  • true - The week field is unavailable
  • false - Default. The week field is available

Technical Details

Return Value: A Boolean value, returns true if the week field is unavailable, otherwise returns false


More Examples

Examples

Check whether the week field is available:

var x = document.getElementById("myWeek").disabled;
xThe output result is:
true

Try it yourself »

Example

Disable or enable the week field:

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

Try it yourself »


Related Pages

HTML Reference Manual:HTML <input> disabled Attribute


Input Week 对象参考手册Input Week Object Other Extensions