Home >Web Front-end >Front-end Q&A >What is the value of html5 time control
html5 There are six values for the time control: 1. "date", which defines the date control; 2. "time", which defines the time control; 3. "datetime-local", which defines the date and time control; 4. "month", defines the month control; 5. "week", defines the week control; 6. "datetime".
The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.
HTML5 defines several new controls related to dates. Browsers that support date controls will provide a convenient drop-down calendar for users to select.
Note: Currently, only Chrome and Opera provide drop-down calendar support, other browsers are still a normal text box.
1. Date control - date
<input type="date" value="2021-01-17"/>
2. Time control - time
<input type="time" value="13:59"/> <input type="time" value="13:59:59"/>
3. Date and time control-datetime-local
<input type="datetime-local" value="2021-01-17T13:59:59"/>
4. Month control - month
<input type="month" value="2021-01"/>
5. Week control - week
<input type="week" value="2022-W02"/>
6. Date and time control--datetime
<input type="datetime" value="2022-01-17T13:59:59"/>
Note: The date and time control also supports min and The max attribute represents the minimum and maximum time that can be set
<input type="date" value="2022-01-17" min="2022-01-16" max="2015-01-26"/>
Related recommendations: "html video tutorial"
The above is the detailed content of What is the value of html5 time control. For more information, please follow other related articles on the PHP Chinese website!