HTML5 输入类型时间设置值不起作用 [英] HTML5 input type time setting values not working

查看:38
本文介绍了HTML5 输入类型时间设置值不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个输入类型时间的表单.我正在尝试设置值.但它没有显示.这是我的代码.

I have a form with input type time. I am trying to set values. But it is not showing. Here is my code.

<input type="time" name="exit" id="teacher-entry-exit-form-exit-input" class="form-control" value="08:56 AM" required="">

我做错了什么?

推荐答案

它基于 24 小时制,因此使用 value="08:56" 表示 AM 和 value="下午 20:56".

It's based on 24-hour time, therefore use value="08:56" for AM and value="20:56" for PM.

此处示例

<input type="time" value="08:56">

参见:http://www.w3.org/TR/html-markup/input.time.html

这篇关于HTML5 输入类型时间设置值不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆