diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/html/global_attributes%2Finputmode.html | |
new repository
Diffstat (limited to 'devdocs/html/global_attributes%2Finputmode.html')
| -rw-r--r-- | devdocs/html/global_attributes%2Finputmode.html | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/devdocs/html/global_attributes%2Finputmode.html b/devdocs/html/global_attributes%2Finputmode.html new file mode 100644 index 00000000..8cfc1cd3 --- /dev/null +++ b/devdocs/html/global_attributes%2Finputmode.html @@ -0,0 +1,61 @@ +<header><h1>inputmode</h1></header><div class="section-content"> +<p> The <code>inputmode</code> <a href="../global_attributes">global attribute</a> is an <a href="https://developer.mozilla.org/en-US/docs/Glossary/Enumerated">enumerated</a> attribute that hints at the type of data that might be entered by the user while editing the element or its contents. This allows a browser to display an appropriate virtual keyboard. </p> <p>It is used primarily on <a href="../element/input"><code><input></code></a> elements, but is usable on any element in <a href="../global_attributes#contenteditable"><code>contenteditable</code></a> mode.</p> <p>It's important to understand that the <code>inputmode</code> attribute doesn't cause any validity requirements to be enforced on input. To require that input conforms to a particular data type, choose an appropriate <a href="../element/input#input_types"><code><input> element type</code></a>. For specific guidance on choosing <a href="../element/input"><code><input></code></a> types, see the <a href="#values">Values</a> section.</p> +</div> +<h2 id="values">Values</h2> +<div class="section-content"> +<p>The attribute can have any of the following values:</p> <dl> <dt id="none"><a href="#none"><code>none</code></a></dt> <dd> <p> No virtual keyboard. For when the page implements its own keyboard input control. </p> </dd> <dt id="text"> +<a href="#text"><code>text</code></a> (default value)</dt> <dd> <p>Standard input keyboard for the user's current locale.</p> </dd> <dt id="decimal"><a href="#decimal"><code>decimal</code></a></dt> <dd> <p> Fractional numeric input keyboard containing the digits and decimal separator for the user's locale (typically <kbd>.</kbd> or <kbd>,</kbd>). Devices may or may not show a minus key (<kbd>-</kbd>). </p> </dd> <dt id="numeric"><a href="#numeric"><code>numeric</code></a></dt> <dd> <p> Numeric input keyboard, but only requires the digits 0–9. Devices may or may not show a minus key. </p> </dd> <dt id="tel"><a href="#tel"><code>tel</code></a></dt> <dd> <p> A telephone keypad input, including the digits 0–9, the asterisk (<kbd>*</kbd>), and the pound (<kbd>#</kbd>) key. Inputs that *require* a telephone number should typically use <code><a href="../element/input/tel"><input type="tel"></a></code> instead. </p> </dd> <dt id="search"><a href="#search"><code>search</code></a></dt> <dd> <p> A virtual keyboard optimized for search input. For instance, the <a href="https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-enterkeyhint-attribute" target="_blank">return/submit key</a> may be labeled "Search", along with possible other optimizations. Inputs that <em>require</em> a search query should typically use <code><a href="../element/input/search"><input type="search"></a></code> instead. </p> </dd> <dt id="email"><a href="#email"><code>email</code></a></dt> <dd> <p> A virtual keyboard optimized for entering email addresses. Typically includes the <kbd>@</kbd>character as well as other optimizations. Inputs that <em>require</em> email addresses should typically use <code><a href="../element/input/email"><input type="email"></a></code> instead. </p> </dd> <dt id="url"><a href="#url"><code>url</code></a></dt> <dd> <p> A keypad optimized for entering URLs. This may have the <kbd>/</kbd> key more prominent, for example. Enhanced features could include history access and so on. Inputs that <em>require</em> a URL should typically use <code><a href="../element/input/url"><input type="url"></a></code> instead. </p> </dd> </dl> +</div> +<h2 id="specifications">Specifications</h2> +<div class="_table"><table class="standard-table"> +<thead><tr><th scope="col">Specification</th></tr></thead> +<tbody><tr><td><a href="https://html.spec.whatwg.org/multipage/interaction.html#attr-inputmode">HTML Standard <br><small># attr-inputmode</small></a></td></tr></tbody> +</table></div> +<h2 id="browser_compatibility">Browser compatibility</h2> +<div class="_table"><table> +<thead> +<tr id="bct-browser-type"> +<th></th> +<th colspan="6">Desktop</th> +<th colspan="6">Mobile</th> +</tr> +<tr id="bct-browsers"> +<th></th> +<th>Chrome</th> +<th>Edge</th> +<th>Firefox</th> +<th>Internet Explorer</th> +<th>Opera</th> +<th>Safari</th> +<th>WebView Android</th> +<th>Chrome Android</th> +<th>Firefox for Android</th> +<th>Opera Android</th> +<th>Safari on IOS</th> +<th>Samsung Internet</th> +</tr> +</thead> +<tbody><tr> +<th><code>inputmode</code></th> +<td class="bc-supports-yes">66</td> +<td class="bc-supports-yes">79</td> +<td class="bc-supports-yes">9517–23</td> +<td class="bc-supports-no">No</td> +<td class="bc-supports-yes">53</td> +<td class="bc-supports-no">No</td> +<td class="bc-supports-yes">66</td> +<td class="bc-supports-yes">66</td> +<td class="bc-supports-yes">79</td> +<td class="bc-supports-yes">47</td> +<td class="bc-supports-yes">12.2</td> +<td class="bc-supports-yes">9.0</td> +</tr></tbody> +</table></div> +<h2 id="see_also">See also</h2> +<div class="section-content"><ul> <li>All <a href="../global_attributes">global attributes</a>.</li> <li> +<a href="enterkeyhint"><code>enterkeyhint</code></a> global attribute</li> </ul></div><div class="_attribution"> + <p class="_attribution-p"> + © 2005–2023 MDN contributors.<br>Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.<br> + <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode" class="_attribution-link">https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode</a> + </p> +</div> |
