Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

HTML DOM Input Email object


May 06, 2021 JavaScript with HTML DOM Reference book


Table of contents


HTML DOM Input Email object


Input Email object

Input Email objects are new to HTML5.

The Input DatetimeLocal object represents an HTML-lt;input> element that uses type-"email".

Note: Internet Explorer 9 (and earlier versions of IE), or Safari does not support HTML and input elements that use type"email".

Access the Input Email object

You can use the getElementById() function to access the elements that use the type-"email" property:

var x = document.getElementById("myEmail"); Give it a try

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

Create an Input Email object

You can use the document.createElement() method to create an element that uses the type-"email" property:

var x = document.createElement("INPUT");
x.setAttribute("type", "email"); Give it a try

Input Email object properties

Property Describe
autocomplete Set or return the autocomplete property value for the email field
autofocus Set or return whether the email field automatically gets focus after the page loads
defaultValue Set or return the default value for the email field
disabled Set or return whether the email field is available
form Returns a form reference that uses the email field
list Returns a datalist reference that contains the email field
maxLength Set or return the maxlength property value of the email field
multiple Whether the setup or return email field can enter more than one email address
name Set or return the name property value of the email field
pattern Set or return the pattern property value of the email field
placeholder Set or return the placeholder property value for the email field
readOnly Set or return whether the email field is read-only
required Set or return whether the email field is required in the form
step Set or return the step property value of the email field
type Returns the type of form element in the e-mail field
value Set or return the value property value of the email field

Standard properties and events

Input Email objects also support standard properties and events.


Related articles

HTML tutorial: HTML forms

HTML Reference Manual: HTML slt;input.gt; Tags

HTML Reference Manual: HTML slt;input> type property