HTML <input type="date">

Last Updated : 25 May, 2026

The HTML <input type="date"> element is used to create a date input field in a form. It allows users to select a date using a calendar interface.

  • Used to accept date input from users.
  • Created using <input type="date"> inside a form.
  • Supports attributes like min, max, value, and required.

Syntax:

<input type="date">

Example: In this example, the HTML <input type="date"> displays a date input field.

HTML
<!DOCTYPE html>
<html>

<head>
    <title>HTML Input Type Date</title>
</head>

<body style="text-align: center;">

    <h2>HTML &lt;input type="date"&gt;</h2>
    
    <form action="#">
        <label for="date"></label>

        <input type="date" id="date" value="2024-05-02">
    </form>
</body>

</html>
Comment