Tor*_*ben 22 html html5 html-input
我想<input type="number">
在我的网站上使用html5元素,但我想知道在不支持此功能的浏览器中该字段会发生什么变化?它不是<input type="text">
这些浏览器的经典领域吗?
0b1*_*011 28
当浏览器无法识别某个特定type
值时<input>
,它将恢复为默认值,即text
.因此,以下所有内容在不支持的浏览器上是等效的: type="number"
<input type="number">
<input type="somevaluethatdoesntexist">
<input type="text">
<input>
Run Code Online (Sandbox Code Playgroud)
对于浏览器做支持type="number"
,该number
<input>
会显示,而不是text
<input>
.
阅读有关type
HTML规范中的属性的更多信息.
参考
在IE和Chrome上打开此示例并查看差异.
If HTML 5 Input Types are not supported on a browser, they will behave as regular text fields.
归档时间: |
|
查看次数: |
11146 次 |
最近记录: |