HTML <input type=”date”>
The 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">
Example: In this example, the HTML <input type=”date”> displays a date input field.
<!DOCTYPE html>
<html>
<head>
<title>HTML Input Type Date</title>
</head>
<body style="text-align: center;">
<h2>HTML <input type="date"></h2>
<form action="#">
<label for="date"></label>
<input type="date" id="date" value="2024-05-02">
</form>
</body>
</html>
Output
Contact Us