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

HTML DOM Input Email disabled property

Input Email disabled property

Input Email Object Reference Input Email Object

Example

Disable the email field:

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

Output result:

Try it »


Definition and Usage

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

Note: Internet Explorer 9 (and earlier IE versions) or Safari browser does not support the HTML element with type="email". .


Syntax

Return the disabled attribute:

emailObject

.disabled

Set the disabled attribute:

emailObject

.disabled=true|false

Attribute values

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

    Technical Details

    Return Value: Boolean, returns true if the email field is not available, otherwise returns false

    More examples

    Example

    Check whether the email field is available:

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

    x

    The output is:

    true

    Try it »

    Example

    Disable or enable the email field:

    function disableBtn() {

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

    }

    function undisableBtn() {

        document.getElementById("myEmail").disabled = false;

    }

    Try it »


    Related pages

    HTML Reference Manual: HTML disabled attribute


    Input Email Object Reference Input Email Object