We've discussed some HTML5 improvements, such as placeholder,prefetching and WebStorage, and here are two new INPUT element types: email and URL. Let's follow the code to see their benefits:
Syntax format:
The new input type attribute replaces text with an email or URL:
The code is as follows:
<!--email, non-@ + @ + non-@ symbol, you can also use the other,
For example [a-za-z0-9]{3,30}@[a-za-z0-9]+w*. (com|cn|org|net)-->
<input type= "Email" pattern= "[^@]*@[^@]*" value= "] >
<!--URL-->
<input type= "url" value= "" >
Using the pattern attribute field peculiar to HTML5, you can provide a regular expression to verify the format of the email and URL addresses, and we will discuss this topic in another article.
Advantages
-can customize special CSS style, Input[type=email]
-can customize special CSS style, Input[type=url]
-More semantic definitions can be done
-Mobile Application Compatibility: Mobile browser will be the email and URL pop-up special keyboard, without user manual switch.
At first I was disgusted with adding extra input type, but after deep thinking I thought it was a good move to improve the user experience, don't you think?