CKTIS / HTML
inputmode — an input mechanism hint
The global inputmode attribute suggests an input mechanism to the browser, usually an on-screen keyboard layout. It does not restrict characters or replace the field type and validation.
Version: WHATWG HTML Living Standard; index snapshot date recorded separately
Syntax
inputmode="none|text|tel|url|email|numeric|decimal|search"inputmode is an enumerated attribute suggesting a suitable input mechanism. It can work on controls such as input and textarea, and in editable content using contenteditable. It is a hint, not a guarantee of a particular keyboard.
Available values: none suggests no virtual keyboard; text — text in the user's locale; tel — telephone input with digits, #, and *; url — URLs; email — email addresses; numeric — digits, for example for a PIN; decimal — fractional numbers with a locale-specific separator; search — searching. numeric and decimal are not interchangeable.
inputmode neither validates data nor blocks letters. type determines the control's kind, whereas autocomplete describes the data's meaning for autofill. An identifier with leading zeros can remain a type="text" field with inputmode="numeric". Define validity rules separately.
When the attribute is omitted or its state is unsupported, the browser should choose a keyboard using context such as type and pattern. The DOM property inputMode reflects the attribute, limiting reads to known values. The example displays numeric and 0072; keyboard appearance depends on the device and browser.
Examples
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>inputmode demo</title>
<label for="code">Code</label>
<input id="code" type="text" inputmode="numeric" value="0072">
<pre id="result"></pre>
<script>
const field = document.getElementById('code');
document.getElementById('result').textContent =
`${field.inputMode}\n${field.value}`;
</script>
</html>Result
numeric 0072
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.