Latest web development tutorials

HTML DOM Input Month disabled property

Input Month Object Reference Input Month Object


Disable month fields:

. Document.getElementById ( "myMonth") disabled = true;

The result could be:

try it"

Definition and Usage

disabled property sets or returns the month whether the field is disabled.

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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the disabled attribute

Note: Internet Explorer or Firefox browser does not support type = "month" <input> element attributes.


Returns disabled properties:

monthObject .disabled

Set the disabled attribute:

monthObject .disabled = true | false

Property Value

value description
true | false Description month field is available.
  • true - month field is unavailable
  • false - default. month field is available

technical details

return value: Boolean value, if the field is unavailable month returns true, otherwise

More examples


View month field is available:

var x = document.getElementById ( "myMonth") disabled.;
x The output is:

try it"


Disable or enable the month field:

function disableBtn () {
. Document.getElementById ( "myMonth") disabled = true;
function undisableBtn () {
. Document.getElementById ( "myMonth") disabled = false;

try it"

Related Pages

HTML Reference Manual: HTML <the INPUT> Disabled Property

Input Month Object Reference Input Month Object