inputModeについて知りたいことはすべて
inputmode
属性は、タッチスクリーンデバイスのブラウザに貴重なヒントを提供し、適切なオンスクリーンキーボードを選択する際にガイドします<input>
および<textarea></textarea>
elements. Unlike altering the input type, inputmode
solely dictates keyboard display, not input interpretation.
While possessing a lengthy history, widespread adoption by major mobile browsers (Safari and Chrome) is relatively recent. Prior implementations in Firefox for Android were short-lived. This support, detailed on caniuse.com, shows version-specific compatibility. Note that my testing suggests Opera Mini and Opera Mobile support contradicts caniuse data.
Although the WHATWG specification documents inputmode
, the W3C 5.2 spec omits it, hinting at potential obsolescence. However, given WHATWG documentation and browser support, we'll consider the WHATWG standard.
inputmode
accepts several values:
none
This value prevents keyboard display in Chrome for Android, though iOS 12.2 shows its default keyboard. It's intended for inputs with custom keyboard controls.
numeric
Highly useful for numerical inputs (PINs, zip codes, etc.). Unlike type="number"
, it allows maxlength
, minlength
, and pattern
attributes, enhancing versatility. While often used with type="tel"
, this is semantically incorrect. The pattern="\d*"
attribute provides a similar effect but limits input strictly to numbers; Android doesn't allow switching to an alphanumeric keyboard, potentially blocking valid entries.
tel
Optimizes telephone number input. It provides a standard telephone keypad (0-9, #, *) with alphabetic mnemonics (ABC, DEF, etc.).
decimal
Produces a keyboard similar to tel
on iOS, replacing the * # key with a decimal point. Android uses the standard numeric keyboard.
email
Includes the @
and .
characters, improving email address entry. iOS's email suggestions might cause confusion. Useful for custom email validation.
url
Facilitates URL entry by including common web address characters (.
, /
) and locale-specific TLDs. Use type="url"
for input validation.
search
Displays a "Go" (iOS) or "Enter" (Android) key, ideal for search forms. type="search"
offers alternative visual cues.
Additional Notes
- Chromium-based Android browsers (Edge, Brave, Opera) mirror Chrome's
inputmode
behavior. - iPad and Android tablet behavior largely mirrors iPhone and Android phones, respectively, excluding third-party keyboards.
-
kana
,katakana
, andlatin-name
values from earlier specifications are no longer implemented. Interestingly,latin-name
on iOS suggests the user's name.
Demo
A live demo showcasing these inputmode
variations is available (link to be provided if a demo is created).
References
- WHATWG specification
- MDN documentation
- caniuse.com
- Chrome Platform Status (Chromium Ticket #244688)
以上がinputModeについて知りたいことはすべての詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

Video Face Swap
完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

人気の記事

ホットツール

メモ帳++7.3.1
使いやすく無料のコードエディター

SublimeText3 中国語版
中国語版、とても使いやすい

ゼンドスタジオ 13.0.1
強力な PHP 統合開発環境

ドリームウィーバー CS6
ビジュアル Web 開発ツール

SublimeText3 Mac版
神レベルのコード編集ソフト(SublimeText3)

ホットトピック











それは&#039; Vueチームにそれを成し遂げてくれておめでとうございます。それは大規模な努力であり、長い時間がかかったことを知っています。すべての新しいドキュメントも同様です。

最近のビットコインの価格が20k $ $ USDを超えており、最近30Kを破ったので、イーサリアムを作成するために深く掘り下げる価値があると思いました

私はこの非常に正当な質問で誰かに書いてもらいました。 Leaは、ブラウザから有効なCSSプロパティ自体を取得する方法についてブログを書いています。それはこのようなものです。

先日、Corey Ginnivanのウェブサイトから、この特に素敵なビットを見つけました。そこでは、スクロール中にカードのコレクションが互いに積み重ねられていました。

これらのデスクトップアプリがいくつかあり、目標があなたのサイトをさまざまな次元ですべて同時に表示しています。たとえば、書くことができます

WordPressエディターでユーザーに直接ドキュメントを表示する必要がある場合、それを行うための最良の方法は何ですか?

フレックスレイアウトの紫色のスラッシュ領域に関する質問フレックスレイアウトを使用すると、開発者ツールなどの混乱する現象に遭遇する可能性があります(D ...
