Global Attributes

HTML inputmode attribute

Hints which virtual keyboard layout to present. It does not constrain permitted values or perform validation. Use it for text identifiers that need a numeric keypad. Applicability: global HTML attribute, subject to element-specific restrictions and browser support.

Formal Syntax & Structure

html syntaxhtml
inputmode="numeric"

Parameters & Attributes

NameTypeDescription
inputmodeenumerated: none, text, decimal, numeric, tel, search, email, urlHints which virtual keyboard layout to present. It does not constrain permitted values or perform validation. Use it for text identifiers that need a numeric keypad.

Working Example

Example Snippethtml
<label>  PIN  <input type="text" inputmode="numeric" pattern="[0-9]{4}"></label>

Browser Compatibility

Minimum supported versions across modern rendering engines

Chrome
66
Yes
Firefox
95
Yes
Safari
12.1
Yes
Checked desktop BCD snapshot: global inputmode attribute. Versions denote the recorded start of support (≤ means at least that early), not a guarantee of all behavior. Unresolved mirror and preview rows omitted. Firefox also supported versions 17–22 before removal in 23; keyboard layouts are platform-specific.
HTML Living Standard
HTML Reference