HTML DOM Input Email Object
Input Email Object
The Input Email object is new in HTML5.
The Input DatetimeLocal object represents an HTML element with type="email". .
Note: Internet Explorer 9 (and earlier IE versions) or Safari browser does not support the HTML element with type="email". .
Accessing the Input Email Object
You can use the getElementById() function to access an element with a type="email" attribute. element:
var x = document.getElementById("myEmail");
Try it
Tip: You can also access the Input Color object through a form'sElementcollection to access the Input Email object.
Creating the Input Email Object
You can use the document.createElement() method to create an element with a type="email" attribute. element:
var x = document.createElement("INPUT");
x.setAttribute("type", "email");
Try it
Input Email Object Properties
| property | Description |
|---|---|
| autocomplete | Sets or returns the autocomplete attribute value of the email field. |
| autofocus | Sets or returns whether the email field automatically gets focus after the page loads. |
| defaultValue | Sets or returns the default value of the email field. |
| disabled | Sets or returns whether the email field is enabled. |
| form | Returns a reference to the form using the email field. |
| list | Returns a reference to the datalist containing the email field. |
| maxLength | Sets or returns the maxlength attribute value of the email field. |
| multiple | Sets or returns whether the email field can accept multiple email addresses. |
| name | Sets or returns the name attribute value of the email field. |
| pattern | Sets or returns the pattern attribute value of the email field. |
| placeholder | Sets or returns the placeholder attribute value 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 step attribute value of the email field. |
| type | Returns the form element type of the email field. |
| value | Sets or returns the value attribute of the email field. |
Standard properties and events
The Input Email object also supports standard property and Events.
Related Articles
HTML Tutorial: HTML Forms
HTML Reference Manual: HTML tag
HTML Reference Manual: HTML type Attribute