16

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

foo@bar.com

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

Konza
  • 2,143
  • 17
  • 30

1 Answers1

22

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.

deceze
  • 510,633
  • 85
  • 743
  • 889