EN
HTML - time input
0 points
In this article, we would like to show you how to create time input element in HTML.
Quick solution:
xxxxxxxxxx
1
<input type="time" name="input-name" />
or:
xxxxxxxxxx
1
<input type="time" name="input-name" min="8:00" max="16:00" />
In this example, we create a simple time input element on the HTML page using input
element's type="time"
attribute.
xxxxxxxxxx
1
2
<html>
3
<body>
4
<label>
5
<span>Select time:</span>
6
<input type="time" name="event-time" />
7
</label>
8
</body>
9
</html>
Note:
Additionally, you can specify the range of time input using
min
andmax
attributes or make the fieldrequired
to fill.xxxxxxxxxx
1<input type="time" name="appt" min="8:00" max="16:00" required />