h5 new form attribute
- min
- max
- required If the form is not entered, submission is prohibited
- step Determine a legal value eg: 3 -6 -3 0 3 6 9
<input type="number" step=3>
This refers to a multiple of 3, not cumulative. If the input box writes 4, the next number greater than 4 is 6 not 7 and the next number smaller than 4 is 3 not 1.
- autocomplete automatic prompt information (historically entered information) attribute value on / off
- Prompt information for placeholder text box
- autofocus autofocus
- The pattern attribute value is a regular expression (efficient string processing rules)
<form action="">
<input type="text"required pattern="^1[3456789]\d{9}$" placeholder="请输入您的手机号">
<input type="submit">
</form>
- novalidate cancel verification
- multiple select (upload) multiple \ input boxes with comma separated as two submitted information
- The list attribute must be used in conjunction with the datalist tag, the id name of the bound datalist
Add a label to the form
<datalist>
The prompt information must be used in conjunction with the list attribute.
<option value="">
A label attribute can be added
</datalist>
<input type="url" list="userlist">
<datalist id="userlist">
<option label="百度" value="http://www.baidu.co">
<option label="腾讯" value="http://www.qq.con">
<option label="京东" value="http://www.jd.con">
<option label="淘宝" value="http://www.taobao.con">
</datalist>
<output for="关联的是要做运算的元素的id名称"><output>
Do output (output of calculation result)
<form action="" οninput="sum.value=parseInt(num1.value)+parseInt(num2.value)">
<input id="num1" type="range" min="10" max="100">
+
<input id="num2" type="text" value="100">
=
<output for="num1 num2" name="sum"></output>
</form>