Dofactory.com
Dofactory.com
Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

HTML <input> type="email"

The <input> tag with a type="email" attribute creates a text field for email addresses.

The input will be validated when the form is submitted.

Example

#

An <input> element of type email.
This email field accepts only a valid @gmail addres which is validated by a pattern.

Your Email

<form action="/tutorial/action.html">
  <fieldset>
    <legend>Your Email</legend>

    <input type="email" name="email"
           placeholder="Enter a gmail address"
           pattern=".+@gmail.com"><br /><br />

    <input type="submit" value="Submit">
  </fieldset>
</form>

Using input type="email"

The <input type="email"> specifies an email input field.

When submitted, validation ensures that the input data is a valid email address.

The optional multiple attribute allows multiple, comma-separated, email addresses.


Syntax

<input type="email">

Browser support

Here is when type="email" support started for each browser:

Chrome
5.0 May 2010
Firefox
4.0 Mar 2011
IE/Edge
10.0 Sep 2012
Opera
10.1 Jun 2009
Safari
5.0 Jun 2010

You may also like

 Back to <input>

Last updated on Sep 30, 2023

Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

Guides