coderef

inputmodeBaseline · Widely available

The inputmode global HTML attribute gives a hint about what type of data is to be entered into an <input> element, such as text, numeric, or email, so the browser may help the user enter data using an adapted input mechanism, such as an on-screen virtual keyboard.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Dec 7, 2021. Widely available since Jun 7, 2024.

Browser support

DesktopChrome
1–65Not supported
66+Supportedsince Apr 17, 2018
Current: 155
Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154
Firefox
1–94Not supported
95+Supportedsince Dec 7, 2021
Current: 157
Safari
1–12Not supported
12.1+Supportedsince Mar 25, 2019
Current: 27
MobileChrome Android
18–65Not supported
66+Supportedsince Apr 17, 2018
Current: 155
Firefox Android
4–68Not supported
79+Supportedsince Jul 28, 2020
Current: 157
Safari iOS
1–12Not supported
12.2+Supportedsince Mar 25, 2019
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: inputMode.

Feature detection

JS · check before using
if ("HTMLElement" in globalThis && "inputMode" in HTMLElement.prototype) {
  // HTMLElement.inputMode is available
}

Sub-features

Support for each part of the feature (2). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
HTMLElement.inputMode66799512.1667912.2
inputmode66799512.1667912.2