Input Email disabledProperty

Input Email 对象参考手册Input Email Object

Examples

Disable the email field:

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

Output result:


Try it yourself »

Definition and Usage

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

Elements using the disabled property are unavailable and unclickable. Disabled elements are usually 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 9 (and earlier IE versions), or Safari browsers do not support HTML <input> elements using type="email".


Syntax

Return the disabled property:

emailObject.disabled

Set the disabled property:

emailObject.disabled=true|false

Property Values

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

Technical Details

Return value: Boolean, returns true if the email field is unavailable, otherwise returns false


More Examples

Examples

Check whether the email field is available:

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

Try it yourself »

Examples

Disable or enable the email field:

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

Try it yourself »


Related Pages

HTML Reference Manual:HTML <input> disabled Attribute


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