The inputmodeglobal attribute hints which on-screen keyboard a device should present for an editable control. Use it when you want a friendlier keypad without switching to a stricter type (for example keep type="text" but show a numeric pad).
Combine with enterkeyhint for the Enter key label, and with pattern / server validation for real constraints. inputmode never validates the value by itself.
Baseline · Widely available.
Modern mobile browsers honor the hint. Desktop physical keyboards are unchanged.
Still validate.
Users can paste or use a hardware keyboard. Enforce allowed characters in script and on the server.
Pair with type, pattern, and enterkeyhint as needed.
One line:inputmode asks for the right soft keyboard without changing the field type.
Frequently Asked Questions
It hints which virtual keyboard layout to show for editable text — for example numeric, tel, email, or url. It does not change the field’s value type or validation by itself.
No. type=number or type=email changes semantics, UI, and validation. inputmode only suggests a keyboard while keeping a text-like control when you need freer input.
numeric is digits (often for PINs or IDs). decimal adds a decimal separator for amounts like prices.
It requests that no virtual keyboard is shown — useful when you provide a custom on-screen keypad.
Usually no visible effect on physical keyboards. Benefits show on phones and tablets.
Yes — widely available on modern browsers, especially mobile.