<input> - email


HTML DOM Input Email object


Input Email object

The Input Email object is new to HTML5.

Input DatetimeLocal objects represent HTML <input> elements with type="email".

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

Access the Input Email object

You can use the getElementById() function to access <input> elements with the type="email" attribute:

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

Try It! 

Tip: You can also access the Input Email object through the form's elements collection.

Create an Input Email object

You can use the document.createElement() method to create an <input> element with the type="email" attribute:

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

Try It! 

Input Email Object Attributes

AttributeDescription
autocompleteSets or returns the value of the autocomplete attribute of the email field
autofocusSets or returns whether the email field automatically gets focus after page load
defaultValueSet or return the default value of the email field
disabledSet or return whether the email field is available
formReturns a form reference using the email field
listReturns a reference to the datalist containing the email field
maxLengthSets or returns the value of the maxlength property of the email field
multipleSets or returns whether multiple email addresses can be entered in the email field
nameSets or returns the value of the name attribute of the email field
patternSets or returns the value of the pattern attribute of the email field
placeholderSets or returns the value of the placeholder attribute of the email field
readOnlySets or returns whether the email field is read-only
requiredSets or returns whether the email field is required in the form
stepSets or returns the value of the step attribute of the email field
typeReturns the form element type of the email field
valueSets or returns the value of the email field's value attribute

Standard Properties and Events

The Input Email object also supports standard properties and events .


Related articles

HTML Tutorial: HTML Forms

HTML Reference Manual: HTML <input> Tag

HTML Reference Manual: HTML <input> type attribute