1. input labels of all type
1.1 Common
Types of |
Explanation |
text |
text |
password |
password |
radio |
Radio |
checkbox |
Multiple choice |
file |
File selector |
button |
Push button |
submit |
submit |
reset |
Reset |
hidden |
Pass hidden values |
image |
image |
1.2 Date Time (HTML5)
Types of |
Explanation |
date |
Custom date field (with calendar control) |
datetime |
Custom date field (with calendar and time controls) |
datetime-local |
Custom date field (with calendar and time controls) |
month |
May-defined date field (with calendar control) |
week |
Periphery defined date field (with calendar control) |
time |
Defining the date field, minutes, seconds (with time control) |
![clipboard.png clipboard.png](https://segmentfault.com/img/bVJGGJ?w=460&h=242)
1.3 color(html5)
Types of |
Explanation |
color |
Defined Color Picker |
![clipboard.png clipboard.png](https://segmentfault.com/img/bVJGEY?w=488&h=313)
1.4 number(html5)
Types of |
Explanation |
number |
Numeric field definitions with spinner controls |
<input type="number" name="points" min="1" max="100" step="2" />
![clipboard.png clipboard.png](https://segmentfault.com/img/bVJGFe?w=205&h=58)
1.5 range(html5)
Types of |
Explanation |
range |
Numeric field definitions with slider controls |
<input type="range" name="points" min="1" max="10" />
![clipboard.png clipboard.png](https://segmentfault.com/img/bVJGFn?w=401&h=72)
1.6 search(html5)
Types of |
Explanation |
search |
Defined text fields for searching, there will be clear button |
![clipboard.png clipboard.png](https://segmentfault.com/img/bVJGFv?w=447&h=73)
1.7 Other
Types of |
Explanation |
email |
There will be an email address check |
tel |
Tel format will check |
url |
Will check url format |
2. input of pattern and required
Types of |
Explanation |
pattern |
Regular calibration check |
required |
Can not be empty |
code show as below:
<input type="text" pattern="^[0-9]{4}$" required="true">
![clipboard.png clipboard.png](https://segmentfault.com/img/bVJGFK?w=428&h=120)
3. readonly和disabled
Types of |
Explanation |
readonly |
Read-only |
disabled |
Disable |
The difference between the two:
The style is not the same, disabled style will change.
When submitting, disable the name, value will not submit; readonly will continue to be submitted.
4. list
Datalist element designated to provide the recommended value as a text box, a value of the id value datalist element. code show as below:
<input type="text" list="dl">
<datalist id="dl">
<option value="1">香蕉</option>
<option value="2">苹果</option>
<option value="3">橘子</option>
<option value="4">西瓜</option>
<option value="5">草莓</option>
<option value="6">柚子</option>
</datalist>
![clipboard.png clipboard.png](https://segmentfault.com/img/bVJGF2?w=367&h=195)
And select difference is, select the option selected value is value, text is displayed in the text option. The datalist general text display option, if the option has value, the display value. Since datalist only available to input the recommended value, generally we do not need value.
5. Other
Types of |
Explanation |
maxlength |
Text length |
size |
Width of the textbox |
placeholder |
prompt |