Home > Web Front-end > Front-end Q&A > Does html5 have a date text box?

Does html5 have a date text box?

青灯夜游
Release: 2022-03-11 17:01:33
Original
2415 people have browsed it

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 .

Does html5 have 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=""/>
Copy after login

Does html5 have a date text box?

##2. Time control - time

<input type="time" value="13:59"/>
<input type="time" value="13:59:59"/>
Copy after login

Does html5 have a date text box?

2-Does html5 have a date text box?

##3. Date and time control - datetime-local

<input type="datetime-local" value=""/>
Copy after login

Does html5 have a date text box?

4. Month control- month

<input type="month" value=""/>
Copy after login

Does html5 have a date text box?

5. Weekly control- week

<input type="week" value=""/>
Copy after login

Does html5 have a date text box?##6. Date and time control--datetime

<input type="datetime" value="2022-01-17T13:59:59"/>
Copy after login

Does html5 have a date text box?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"/>
Copy after login

Does html5 have a date text box?[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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template