HTML5输入类型日期,颜色,范围支持在Firefox和Internet Explorer [英] HTML5 input type date, color, range support in Firefox and Internet Explorer
问题描述
我已经使用多种HTML5格式建立我的网站(使用输入类型
和日期
c $ c> color range
。)
I've build all my website using many forms with HTML5 (using the input
types date
, color
and range
.)
。
但是当我打开Internet Explorer和Firefox时,所有输入字段都变成 input
type text
。
But when I turn on Internet Explorer and Firefox, all input fields become like input
type text
.
有没有办法或脚本可以下载来强制正确显示这个输入?
Is there a way or a script I can download to make forcing the displaying of this input correctly?
推荐答案
由于HTML5尚未完全标准化,因此并非所有浏览器都支持这些输入类型。 的行为是回到< input type =text>
。
Since HTML5 hasn't been completely standardized yet, not all browsers do support these input types. The intended behaviour is to fall back to <input type="text">
.
您可以使用Modernizr库或一些自定义JavaScript 测试支持。如果您检测到某个HTML5功能不可用,则可以返回 JavaScript - 基于 替代品。
You can test for support using the Modernizr library or with some custom JavaScript. If you detect a certain HTML5 feature isn't available, you can fall back to JavaScript-based alternatives.
这篇关于HTML5输入类型日期,颜色,范围支持在Firefox和Internet Explorer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!