Computer >> Computer tutorials >  >> Programming >> HTML

How to use email input type in HTML?


The email input type is used in HTML using the <input type="email">. Using this, allow the users to add an e-mail address. On some browsers, the email entered will be validated i.e. if you miss @ and. (period), while adding e-mail, then it won’t submit the form and will show an error i.e. “Please enter an email address”.

Use the multiple Boolean attributes, if you want to allow adding more than one email address.

Note − The input type email is not supported in Internet Explorer 9 and earlier.How to use email input type in HTML?

Example

You can try to run the following code to learn how to use email input type in HTML −

<!DOCTYPE html>
<html>
   <head>
      <title>HTML input email</title>
   </head>

   <body>
      <form action = "" method = "get">
         Details:<br><br>
         Student Name<br><input type = "name" name = "sname"><br>
         Student E-mail<br><input type = "email" name = "email"><br>
         <input type = "submit" value = "Submit">
      </form>
   </body>
</html>