HTML <input type=”time”>
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.
<!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 Browsers
The browsers supported by <input type=”time”> are listed below:
- Chrome 20
- Edge 12
- Firefox 57
- Opera 10
- Safari 14.1
Contact Us