html ie中的输入框时间

发布于 2024-12-05 02:48:31 字数 257 浏览 6 评论 0原文

我想要一个“时间”输入框(播种箭头以增加/减少时间)。以下代码在 chrome/mozilla 中有效,但在 Internet Explorer 中无效:

    <label for="moduleStart">Hours from:</label>
    <input type="time" name="moduleStart" class="dateFormat"/>

如何解决此问题?

I want to get a 'time' input box (that sows the arrows to increase/decrease time). The following code works in chrome/mozilla but it doesnt in internet explorer :

    <label for="moduleStart">Hours from:</label>
    <input type="time" name="moduleStart" class="dateFormat"/>

How can this be fixed?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

缱绻入梦 2024-12-12 02:48:31

许多元素类型是 HTML5 中的新元素,因此旧版浏览器不支持。您可以为非 HTML5 浏览器使用polyfill

在这种情况下,例如:

http://dl.dropbox.com/u/598365 /html5forms/html5forms.html

目标是让作者使用大多数 HTML5 控件类型并且
属性即使在尚不支持所有这些新功能的浏览器中
HTML5 功能
。其中一些功能仅在
最新版本的 Opera 以及部分基于 Webkit 的浏览器。到
实现这一目标我们需要有能力识别并正确处理
验证这些新类型并能够设置:

Many element types are new in HTML5 thus not supported by older browsers. You could use a polyfill for non HTML5 browsers.

In this case one like:

http://dl.dropbox.com/u/598365/html5forms/html5forms.html

The objective is to allow authors to use most HTML5 control types and
attributes even in browsers which do not yet support all these new
HTML5 features
. Some of these features are only implemented in the
latest version of Opera and partially in Webkit based browsers. To
achieve this we need the ability to recognize and handle correct
validation for these new types and be able to set:

囚你心 2024-12-12 02:48:31

Internet Explorer 不支持此输入类型。

Internet explorer does not support this input type.

美煞众生 2024-12-12 02:48:31

使用 HTML5 Modernizer 在不支持新输入的浏览器中支持 HTML5 新输入类型

来自文档:

这些类型可以启用本机日期选择器、颜色选择器、URL
验证等。如果浏览器不支持给定类型,它
将呈现为文本字段。 Modernizr 无法检测到该日期
输入创建一个日期选择器,颜色输入创建一个颜色选择器,并且
依此类推 - 它将检测输入值是否已根据
规格就 WebKit 而言,我们已收到确认
如果 UI 小部件就位,则不会添加清理。

Use HTML5 Modernizer to support HTML5 new input types in browsers that don't support new inputs

From Docs:

These types can enable native datepickers, colorpickers, URL
validation, and so on. If a browser doesn’t support a given type, it
will be rendered as a text field. Modernizr cannot detect that date
inputs create a datepicker, the color input create a colorpicker, and
so on—it will detect that the input values are sanitized based on the
spec. In the case of WebKit, we have received confirmation that
sanitization will not be added without the UI widgets being in place.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文