YouTip LogoYouTip

Prop Email Disabled

HTML DOM Input Email disabled Property

HTML DOM Input Email disabled Property

Input Email Object Reference

Example

Disable the email field:

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

Output:

Try it Yourself Β»


Definition and Usage

The disabled property sets or returns whether an email field should be disabled, or not.

A disabled field is unusable and un-clickable. Disabled fields are usually displayed in grey.

The property reflects the HTML disabled attribute.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

The disabled property is supported in all major browsers.

Note: Internet Explorer 9 (and earlier) or Safari does not support the HTML <input> element with type="email".


Syntax

Return the disabled property:

emailObject.disabled

Set the disabled property:

emailObject.disabled=true|false

Property Values

Value Description
true|false Specifies whether the email field should be disabled or not.
  • true - The email field is disabled
  • false - Default. The email field is not disabled

Technical Details

Return Value: A Boolean. Returns true if the email field is disabled, otherwise it returns false

More Examples

Example

Check if the email field is disabled:

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

x will be:

true

Try it Yourself Β»

Example

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: HTML <input> disabled Attribute


Input Email Object Reference

← Prop Email FormProp Email Autofocus β†’