Home >Web Front-end >H5 Tutorial >Introduction to url type and email type of input element_html5 tutorial skills

Introduction to url type and email type of input element_html5 tutorial skills

WBOY
WBOYOriginal
2016-05-16 15:51:071609browse

In the past, when we made web page input boxes, we used a lot of JS verification. Now with HTML5, writing this effect is no longer so troublesome. Let me introduce to you two new types of HTML5 input applications.
1. URL type:





After setting this type, from the appearance point of view It is almost the same as an ordinary element, but if you put this type into the form and click the submit button, if the input in this input box is not a URL address, it will not be submitted.

The operation effect is as follows:

2. Email type:

 
 

If we change the type in the above URL type code to email, then when the form is submitted, it will automatically verify whether the content in this input box is in email format. If not, it cannot submit.

If you don’t understand something, you can also leave a message directly to Script House and I will reply to you as soon as possible.
If you understand this, you can practice it yourself and post the exercises to help everyone improve together!
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