Comments: In the past, we made web page input boxes and used a lot of JS verification. Now, HTML5 writing is not so troublesome, next I will introduce the newly added types of HTML5 input applications. In the past, we used a lot of JS verification to create web page input boxes. Now, HTML5 writing is not so troublesome, next I will introduce the newly added types of HTML5 input applications.
1. URL type:
<Form>
<Input name = "urls" type = "url" value = "http://www.jb51.net/"/>
<Input type = "submit" value = "submit"/>
</Form>
After this type is set, the appearance is similar to that of a common element. However, if you place this type in a form, click the submit button, if the input box is not a URL address, it cannot be submitted.
The running effect is as follows:
2. Email type:
<Form>
<Input name = "email" type = "email" value = "http://www.jb51.net/"/>
<Input type = "submit" value = "submit"/>
</Form>
If we change the type in the above URL type code to email, when the form is submitted, the system automatically verifies whether the content in the input box is in the email format. If not, cannot be submitted.
If you do not understand it, you can leave a message directly to the home of your feet. I will reply to you as soon as possible.
If you understand this, you can practice it yourself and publish the exercises to help you make progress together!