html5 has a date text box; you only need to add the type attribute to the input text box and set the attribute value to date, time, datetime-local, month, week or datetime to convert the ordinary input box into a date text box .
The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.
html5 has a date text box.
HTML5 defines several new controls related to dates. Browsers that support date controls will provide a convenient drop-down calendar for users to select.
You only need to add the type attribute to the input text box, and set the attribute value to date, time, datetime-local, month, week or datetime.
1. Date control - date
<input type="date" value=""/>
##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=""/>
<input type="month" value=""/>
<input type="week" value=""/>
##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 max attributes, indicating the minimum and maximum time that can be set
<input type="date" value="2022-03-17" min="2022-03-16" max="2022-03-26"/>
[Related recommendations:
html video tutorial
web front-end】
The above is the detailed content of Does html5 have a date text box?. For more information, please follow other related articles on the PHP Chinese website!