Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Input Month disabled Property

Input Month disabled Property

Input Month Object Reference Input Month Object

Example

Disable the month field:

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

The result could be:

Try it »


Definition and Usage

The disabled property is used to set or return whether the month 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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the disabled property

**Note:** Internet Explorer or Firefox browsers do not support the HTML using the type="month" attribute .


Syntax

Return the disabled attribute:

monthObject

.disabled

Set the disabled attribute:

monthObject

.disabled=true|false

Attribute values

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

    Technical Details

    Return Value: Boolean, returns true if the month field is unavailable, otherwise returns

    More examples

    Example

    Check whether the month field is available:

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

    x

    The output is:

    true

    Try it »

    Example

    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 disabled attribute


    Input Month Object Reference Input Month Object