Home >Web Front-end >Front-end Q&A >What is the value of html5 time control

What is the value of html5 time control

青灯夜游
青灯夜游Original
2022-01-17 14:55:042608browse

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".

What is the value of html5 time control

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

What is the value of html5 time control

<input type="date" value="2021-01-17"/>

2. Time control - time

What is the value of html5 time control

2-What is the value of html5 time control

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

3. Date and time control-datetime-local

What is the value of html5 time control

<input type="datetime-local" value="2021-01-17T13:59:59"/>

4. Month control - month

What is the value of html5 time control

<input type="month" value="2021-01"/>

5. Week control - week

What is the value of html5 time control

<input type="week" value="2022-W02"/>

6. Date and time control--datetime

What is the value of html5 time control

<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

What is the value of html5 time control

<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!

Statement:
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