Open In App

HTML <input type=”date”>

Improve
Improve
Like Article
Like
Save
Share
Report

HTML <input type=”date”> element provides a date picker interface for selecting dates. It allows users to input dates using a calendar widget, ensuring standardized date input across different browsers and devices. 

Syntax:

<input type="date"> 

HTML <input type=”date”> Examples

Example 1: 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>
    <h2>HTML &lt;input type="date"&gt;</h2>

    <!-- Corrected value format -->
    <input type="date" 
           id="test" 
           value="2019-07-02">

</body>

</html>

Output: 

HTML-input-type-date-example

HTML Input type date Example

Supported Browsers: 


Last Updated : 12 Mar, 2024
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads