Open In App

HTML <input type="time">

Last Updated : 20 May, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

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 &lt;input type="time"&gt;</h2>

    <form action="#">
        <label for="time">Input Time:</label>
        <input type="time" name="time" id="time">
    </form>
</body>

</html>

Output

HTML-Input-Type-Time

Supported Browsers

The browsers supported by <input type="time"> are listed below:

  • Chrome 20
  • Edge 12
  • Firefox 57
  • Opera 10
  • Safari 14.1

Next Article

Similar Reads