The inputmode attribute on <input> and <textarea> is a hint to mobile browsers about which on-screen keyboard layout to show when the field receives focus. Without it, users see the default text keyboard and have to mode-switch -- 2-3 extra taps per phone-number, OTP, or numeric-ID field.
Defined values:
none-- no keyboard (use a custom input UI)text-- standard text keyboard (the default)decimal-- numeric keypad with.(or locale equivalent)numeric-- digits-only keypadtel-- telephone keypad with*,#, etc.search-- text keyboard with a "Go" / "Search" return keyemail-- text keyboard with@and.quick-accessurl-- text keyboard with/and.comquick-access
inputmode complements but doesn't replace type=:
type="email"andtype="tel"already trigger appropriate keyboards on most browsers, but cross-browser consistency is poor;inputmodemakes the choice explicit.- One-time-code fields and PIN entries are typically
<input type="text" inputmode="numeric" autocomplete="one-time-code">--type=textbecause the native validation isn't useful,inputmode=numericfor the right keyboard.
Performance / UX impact: small per-field but cumulative -- saving 2 taps × 5 numeric fields × hundreds of users / day adds up to material time savings. Especially noticeable on mobile checkout flows.