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.
<!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>