如何强制HTML时间输入仅呈现小时数?我不需要输入分钟和秒钟。
<label for="appt">Choose a time for your meeting:</label>
<input type="time" id="appt" name="appt"
min="07:00" max="18:00" value="07:00" required>
<small>Office hours are 9am to 6pm</small>
答案 0 :(得分:2)
您可以使用step = 3600
<label for="appt">Choose a time for your meeting:</label>
<input type="time" id="appt" name="appt"
min="07:00" max="18:00" value="07:00" step=3600 required>
<small>Office hours are 9am to 6pm</small>
更多详细信息here