HTML Input Elements
Creates a date picker control. | HTML 2, 3.2, 4, 4.01, 5 |
HTML Syntax
<input
type = date
>
NOTE: Only the <input
> start tag must be present. The element has no end tag.
The <input type=date
> element is used to create a control for entering a date ( year, month, and day, with no time ).
The control renders as a date picker or numeric wheels for year, month, day when active in supporting browsers.
<input type=date
> may be specified with min and max attributes to restrict the dates that can be chosen by the user.
The control may also be specified with a value attribute, to set a default value for the input.
The appearance of the date picker UI varies, based on the browser and operating system.
The resulting value includes the year, month, and day, but not the time. The value is normalized to the format yyyy-mm-dd.
The <input_date>
element has no attribute of its own, but supports global attributes common to all HTML elements.
The following example shows how a simple <input type=date
> control renders on a web page.
<input type=date>
INPUT INPUT type=datetime-local