Last Updated : 20 May, 2024
The HTML <input type="time"> element creates a time input field, allowing users to select a time (including hours and minutes) from a pre-defined list or by entering it manually. It provides a standardized way to input time values, enhancing user experience in forms that require time-based inputs.
Syntax<input type="time">
Example: This example demonstrates the use of HTML <input type="time"> element.
HTML
<!DOCTYPE html>
<html>
<head>
<title>
HTML Input Type Time
</title>
</head>
<body style="text-align:center;">
<h2>HTML <input type="time"></h2>
<form action="#">
<label for="time">Input Time:</label>
<input type="time" name="time" id="time">
</form>
</body>
</html>
Output
Supported BrowsersThe browsers supported by <input type="time"> are listed below:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4