Input Week disabled attribute

Definition and usage

disabled Attribute sets or returns whether the week field should be disabled.

Disabled elements are not available and cannot be clicked. By default, disabled elements are usually displayed in gray in the browser.

This attribute reflects the HTML disabled attribute.

See also:

HTML Reference Manual:Atrybut disabled <input> w HTML

Example

Example 1

Disable the week field:

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

Try it yourself

Example 2

Check if the week field is disabled:

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

Try it yourself

Example 3

Disable and cancel the disable of the week field:

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

Try it yourself

Syntax

Return disabled attribute:

weekObject.disabled

Set disabled attribute:

weekObject.disabled = true|false

Attribute value

Value Description
true|false

Determine whether the field for week should be disabled.

  • true - Field for week is disabled
  • false - domyślnie. Pole tygodnia nie jest wyłączone

Szczegóły techniczne

Zwrócona wartość: Wartość logiczna, zwracana, jeśli pole tygodnia jest wyłączone true; w przeciwnym razie zwróć false.

Obsługa przeglądarek

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Obsługa 10.0 Obsługa Obsługa Obsługa

Uwaga:Element <input type="week"> nie wyświetla żadnego pola dat lub kalendarza w Firefox.