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!