强制A引领零在页面上显示输入类型=“文本”时间格式HH:MM:SS
html markup < input type =“ text” value =“ 00:00:00” class =“ datepicker time” aria-invalid =“ false”>
不会在一个中显示领先零带有时间格式的文本输入HH:MM:SS。即使输入的值为00:00:00,页面也显示为0:00:00。我如何强迫领先的零显示?
HTML markup <input type="text" value="00:00:00" class="datepicker-time" aria-invalid="false">
does not display the leading zero in a text input with time format hh:mm:ss. Even though the value for the input is 00:00:00, the page shows 0:00:00. How can I force the leading zero to display?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如@paulie_d所说 - 使用
type ='time'
而不是文本..&lt; input type =“ time” value =“ 00:00” class =“ datepicker time” aria-无效=“ false”/&gt;
要注意的一件事是, developer.mozilla.org 在
js
和常规 html 项目中都有很多有关如何使用此方法的好信息。As @Paulie_D said - use
type='time'
instead of text..<input type="time" value="00:00" class="datepicker-time" aria-invalid="false"/>
One thing to note is that developer.mozilla.org has a lot of good info on how you can use this, both in
JS
and the generalHTML
items.