Easy Tutorial
❮ Jsref Negative Infinity Jsref Obj Boolean ❯

Input Email required Attribute

Input Email Object

Example

Check if the email field is a required field before submitting the form:


Definition and Usage

The required attribute is used to set or return whether the email field is a required field in the form.

This attribute reflects the HTML required attribute.


Browser Support

All major browsers support the required attribute, except Internet Explorer 9 and earlier versions, and Safari.

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


Syntax

Return the required attribute:

Set the required attribute:

Attribute Values

Value Description
true|false Describes whether the email field is a required part of the form before submission. true - The email field is a required part of the form. false - Default. The email field is an optional part of the form.

Technical Details

| Return Value: | Boolean, returns true if the email field is a required part of the form, otherwise returns false. | | --- | --- |


More Examples

Example

Set the email field as a required part of the form:


Related Pages

HTML Reference: HTML <input> required Attribute


❮ Jsref Negative Infinity Jsref Obj Boolean ❯