HTML5 adds many new tags and attributes. Many JS judgments may be used for form verification. Now, with the newly added HTML5 attributes, we can easily make judgments.
To test these attributes, you can see on this page: Click to enter the test page.
The main attributes added to the form are:
1. Email: enter a single email address or email address list.
2. url: it is used to process the URL. It is very useful in the iPhone and the corresponding keyboard layout will appear.
3. Tel: Enter the phone number.
4. Search: displays a form for entering search keywords.
5. Range: the slider is displayed. Set acceptable numbers. Step specifies the valid digit interval. (C5, S4, o10.1)
6. Number: An input field that contains numeric values. You can set acceptable numbers.
7. Date: form field used for date selection. Date, month, and week are supported.
8. Color: A color input form.
9. autofocus: used to locate the form element. (C5, S4)
10. placeholder: displays the placeholder text content in the form.
11. contenteditable: edit the content on the webpage.
12. AutoComplete: notifies the browser not to automatically fill in data for the current form field.