HTML5 input element types: email and url introduction_html5 tutorial skills
WBOYOriginal
2016-05-16 15:49:012598browse
In the previous blog post, we have discussed some improvements in HTML5, such as placeholder, prefetching and webStorage. What I want to introduce below are two new input element types: email and url. Let's follow the code to see their benefits:
Syntax format: New input type attribute, will use email or url instead of text:
Copy code
The code is as follows:
< input type="url" value="">
Using the pattern attribute field unique to HTML5, you can provide a regular expression to verify the format of email and url addresses. We This topic will be discussed in another article.
Advantages - You can customize special css styles, input[type=email] - You can customize special css styles, input[type=url] - More semantic definitions can be made - Mobile application adaptability: Mobile browsers will pop up special keyboards for email and URL, without the need for users to manually switch.
At first I was disgusted with adding redundant input types, but after thinking about it deeply, I think it is a good move to improve user experience. What do you think?
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn