Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does HTML5 input type email works without top level domain name

Tags:

html

The input type = email tag in html5 works even if the top level domain name is not present

<form action = "yourPage" method = "get">
    <input type =  'email' name ="emailName" >
    <input type = 'submit'>
</form>

for eg: if we type

foo@bar

instead of

[email protected]

The form will be submitted. Can anyone explain why it behaves like this.

like image 781
Konza Avatar asked Jan 17 '13 06:01

Konza


1 Answers

Because bar is a valid hostname, which makes foo@bar a valid email address.

Chrome is not going to check for you whether the address or host are actually in use, only whether the semantics are correct.

See http://en.wikipedia.org/wiki/Email_address#Domain_part for examples of valid email addresses.

like image 138
deceze Avatar answered Oct 08 '22 20:10

deceze