It was quite tedious to validate an email in HTML 4. It requires some external Java script to validate particular field. Here you will see some magics in HTML 5 to validate an email it’s doesn’t require external java script and it validate by itself without extra code.
Email Address Validation in HTML5
Note : Following code only works in HTML 5 supported browsers like Safari 5, Google Chrome 6, Mozilla Firefox 4, Opera 10 and higher versions of browsers.
Note : Lower versions of browsers will treat that email filed in the HTML 5 as normal text field.
<!DOCTYPE html> <html lang="en"> <head> <title>Email validation in HTML5</title> </head> <body> <form> <input type="email" placeholder="me@example.com"> <input type="submit"> </form> </body> </html>
Enter E-mail address to test :