Html Input Type="date" 在 IE 中不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13955096/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 04:27:51  来源:igfitidea点击:

Input Type="date" doesn't work in IE

htmlbrowser

提问by ncurran217

Why does the type="date" work in Chrome but not IE:

为什么 type="date" 在 Chrome 中有效,而在 IE 中无效:

<input name="start_date" type="date" value="<?php echo $today;?>" autocomplete="off" required="required">

If you need more information let me know. Thanks!

如果您需要更多信息,请告诉我。谢谢!

回答by Thomas Jones

input type='date' is an HTML 5 feature. As such, it is not implemented by all browsers yet, and will not be supported by older browsers like IE 7 and 8.

input type='date' 是 HTML 5 功能。因此,它还没有被所有浏览器实现,并且不会被 IE 7 和 8 等旧浏览器支持。

http://caniuse.com/#search=date

http://caniuse.com/#search=date

You should use a polyfill with javascript to handle these cases and provide a consistent user experience on browsers that dont support HTML5.

您应该使用带有 javascript 的 polyfill 来处理这些情况,并在不支持 HTML5 的浏览器上提供一致的用户体验。

回答by DKSan

You can test, which elements of new HTML5 standard are supported by which browser by just opening site like http://html5test.com/in your browser

您可以测试,其中新的HTML5标准元素通过由刚刚开放的网站浏览器,如支持http://html5test.com/在您的浏览器