HTML DOM Input Email Object
Input Email Object
The Input Email object is new in HTML5.
The Input DatetimeLocal object represents the HTML <input> element with type="email".
Note:Internet Explorer 9 (and earlier IE versions), or Safari, does not support the HTML <input> element with type="email".
Access an Input Email Object
You can use the getElementById() function to access the <input> element with the type="email" attribute:
var x = document.getElementById("myEmail");
Try it Yourself
Tip:You can also access the Input Email object through the form'selementscollection.
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 Yourself
x.setAttribute("type", "email"); Try it Yourself
Input Email Object Properties
| Property | 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 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 that contains the email field |
| list | Returns the reference to the datalist that contains the email field |
| maxLength | Sets or returns the value of the maxlength attribute 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 a required field 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 value attribute of the email field |
Standard Properties and Events
The Input Email object also supports standardpropertiesandevents。
Related Articles
HTML Tutorial:HTML Forms
HTML Reference Manual:HTML <input> Tag
HTML Reference Manual:HTML <input> type Attribute
Other Extensions