<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");
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");
Input Email Object Attributes
Attribute | Description |
---|---|
autocomplete | Sets or returns the value of the autocomplete attribute of the email field |
autofocus | Sets or returns whether the email field automatically gets focus after page load |
defaultValue | Set or return the default value of the email field |
disabled | Set or return whether the email field is available |
form | Returns a form reference using the email field |
list | Returns a reference to the datalist containing the email field |
maxLength | Sets or returns the value of the maxlength property of the email field |
multiple | Sets or returns whether multiple email addresses can be entered in the email field |
name | Sets or returns the value of the name attribute of the email field |
pattern | Sets or returns the value of the pattern attribute of the email field |
placeholder | Sets or returns the value of the placeholder attribute of the email field |
readOnly | Sets or returns whether the email field is read-only |
required | Sets or returns whether the email field is required in the form |
step | Sets or returns the value of the step attribute of the email field |
type | Returns the form element type of the email field |
value | Sets 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