HTML DOM Input Email Object

Email object

The Email object is a new object in HTML5.

The Email object represents the HTML <email> element.

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

Access Email object

You can access the <email> element using getElementById():

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

Try it yourself

Create Email object

You can create an <email> element using the document.createElement() method:

var x = document.createElement("INPUT");
x.setAttribute("type", "email");

Try it yourself

Email object properties

Properties Description
autocomplete Set or return the autocomplete attribute value of the email field.
autofocus Set or return whether the email field should automatically focus after the page is loaded.
defaultValue Set or return the default value of the email field.
disabled Set or return whether the email field is disabled.
form Return a reference to the form containing the email field.
list Return a reference to the datalist containing the email field.
maxLength Set or return the value of the maxlength attribute of the email field.
multiple Set or return whether multiple email addresses can be entered in the email field.
name Set or return the name attribute value of the email field.
pattern Set or return the pattern attribute value of the email field.
placeholder Set or return the placeholder attribute value of the email field.
readOnly Set or return whether the email field is read-only.
required Set or return whether the email field must be filled out before submitting the form.
size Set or return the size attribute value of the email field.
type Return the form element type of the email field.
value Set or return the value of the email field's value attribute.

Input Email Object Methods

Method Description
select() Select the content of the email text field.

Standard Properties and Events

The Email Object Supports StandardsPropertiesAndEvents.

Related Pages

HTML Tutorial:HTML Forms

HTML Reference Manual:HTML <input> Tag

HTML Reference Manual:HTML <input> type Attribute