HTML inputmode 属性
- Previous page inert
- Next page lang
- Go back one level HTML Global Attributes
实例
提示:请在手机或平板电脑上运行实例,以查看结果。
例子 1
在(虚拟)键盘上只显示数字键:
<input type="text" inputmode="numeric">

例子 2
下面的实例使用了 "email" 的 "inputmode":
<input type="text" inputmode="email">

语法
<element inputmode="decimal|email|none|numeric|search|tel|text|url">
Attribute value
Value | Description |
---|---|
decimal | Only display numeric keyboard, usually with a comma key. |
Text keyboard, keys are usually used for email addresses, such as [@]. | |
none | Keyboard should not appear. |
numeric | Only display numeric keyboard. |
search | Text keyboard, the [enter] key is usually displayed as [go]. |
tel | Only display numeric keyboard, usually with [+]、[*] and [#] keys. |
text | Default. Text keyboard. |
url | Text keyboard, keys are usually used for URLs, such as [.] and [/], as well as special [.com] keys, or other domain name endings commonly used in local settings. |
Browser support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
66 | 79 | 95 | 12.2 | 53 |
- Previous page inert
- Next page lang
- Go back one level HTML Global Attributes