DATE html code example

Example 1: how to set a date for type date inpt

<input type="date" id="start" name="trip-start" value="2018-07-22">

Example 2: calendar input

<input type="date" data-date-inline-picker="true" />

Example 3: html date

<label for="meeting">Next meeting (August 2021):</label>
<input type="date" 
       id="meeting" 
       name="meeting"
       min="2021-08-01" 
       max="2021-08-31"
       defaultValue="2021-08-01">

Example 4: date tag html

The <input type="date"> defines a date picker.
The resulting value includes the year, month, and day.
Tip: Always add the <label> tag for best accessibility practices!

<label for="birthday">Birthday:</label>
<input type="date" id="birthday" name="birthday">

Tags:

Html Example