Introduction to the url and email types of input Elements

Source: Internet
Author: User

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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.