The first knowledge point: attributes and summary of forms
The second knowledge point: H5’s new form controls and properties and summary
The first knowledge point:What are our common form validations?
text text box label
password password box
checkbox multiple checkbox
radio radio button
button button
submit submit button
The above are some of our commonly used form attributes
The second knowledge point: H5 new input control(1) email: email text box, no different from ordinary ones
1. When the input is not an email address, the verification fails.
2. The mobile keyboard will change
(2) tel: phone number
1. Mainly on mobile terminal, one keyboard switching
(3) url: URL of the web page
Enter the correct URL
(4) sear: search engine
1. After entering text in chrome, there will be an extra closed x
(5) Range: Value selector within a specific range
1.min, max, step (number of steps)
2. Example: Use js to display the current value
(6) number: an input box that can only contain numbers
(7) color: color selector
(8) detetime displays the complete date
(9) autocomplete: whether to save the user input value
The default is on, to turn off the prompt select off
(10): Specify the form to obtain input focus
(11): This item is required and cannot be empty
If you only write in the first input box, the second input box will pop up. Please fill in this field.
(12) parrern: regular verification pattrn=/d{1,5}
The regular expression I set is 1-5 numbers. If it is not the number, the submission will fail.
SummarizeThe above is a detailed explanation of the new HTML5 form controls and form attribute example codes introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time!