大网数据广告活动
Web 标准与前端开发

HTMLElement: inputMode property

· 52CE 我爱测

The HTMLElement property **`inputMode`** reflects the value of the element's `inputmode` attribute.

HTML DOM

The HTMLElement property inputMode reflects the value of the element's inputmode attribute.

It provides a hint about the type of data that might be entered by the user while editing the element or its contents. This allows the browser to display an appropriate virtual keyboard.

It is used primarily on input elements, but is usable on any element in contenteditable mode.

Value

This attribute may have one of the following values:

  • decimal
    • : Fractional numeric input keyboard that contains the digits and decimal separator for the user's locale (typically <kbd>.</kbd> or <kbd>,</kbd>).
  • email
    • : A virtual keyboard optimized for entering email addresses. Typically includes the <kbd>@</kbd>character as well as other optimizations.
  • none
    • : No virtual keyboard. This is used when the page implements its own keyboard input control.
  • numeric
    • : Numeric input keyboard that only requires the digits 0–9. Devices may or may not show a minus key.
  • search
    • : A virtual keyboard optimized for search input. For instance, the return/submit key may be labeled "Search".
  • tel
    • : A telephone keypad input that includes the digits 0–9, the asterisk (<kbd>*</kbd>), and the pound (<kbd>#</kbd>) key.
  • text
    • : Standard input keyboard for the user's current locale.
  • url
    • : A keypad optimized for entering URLs. This may have the <kbd>/</kbd> key more prominent, for example.

For details on the usage of this attribute, see the page for the inputmode HTML attribute that this property reflects.

Specifications

Browser compatibility

See also

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。