enterkeyhint HTML global attribute

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since November 2021.

The enterkeyhint global attribute is an enumerated attribute defining what action label (or icon) to present for the enter key on virtual keyboards.

Try it

<input enterkeyhint="go">

<p contenteditable="" enterkeyhint="go">https://example.org</p>

Description

Form controls (such as <textarea> or <input> elements) or elements using contenteditable can specify an inputmode attribute to control what kind of virtual keyboard will be used. To further improve the user's experience, the enter key can be customized specifically by providing an enterkeyhint attribute indicating how the enter key should be labeled (or which icon should be shown). The enter key usually represents what the user should do next; typical actions are: sending text, inserting a new line, or searching.

If no enterkeyhint attribute is provided, the user agent might use contextual information from the inputmode, type, or pattern attributes to display a suitable enter key label (or icon).

Value

The enterkeyhint attribute is an enumerated attribute and only accepts the following values:

Value Description Example label (depends on user agent and user language)
enterkeyhint="enter" Typically inserting a new line. return, ↵
enterkeyhint="done" Typically meaning there is nothing more to input and the input method editor (IME) will be closed. done, ✅
enterkeyhint="go" Typically meaning to take the user to the target of the text they typed. go, 🡢
enterkeyhint="next" Typically taking the user to the next field that will accept text. next, ⇥
enterkeyhint="previous" Typically taking the user to the previous field that will accept text. return, ⇤
enterkeyhint="search" Typically taking the user to the results of searching for the text they have typed. search, 🔍
enterkeyhint="send" Typically delivering the text to its target. send

Specifications

Specification
HTML
# attr-enterkeyhint

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
enterkeyhint
Chrome – Full support
Chrome 77 (Release date: 2019-09-10)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 94 (Release date: 2021-11-02)
footnote Full support
Opera – Full support
Opera 66 (Release date: 2020-01-07)
footnote Full support
Safari – Full support
Safari 13.1 (Release date: 2020-03-24)
footnote Full support
Chrome Android – Full support
Chrome Android 77 (Release date: 2019-09-10)
footnote Full support
Firefox for Android – Full support
Firefox for Android 94 (Release date: 2021-11-02)
footnote Full support
Opera Android – Full support
Opera Android 57 (Release date: 2020-03-30)
footnote Full support
Safari on iOS – Full support
Safari on iOS 13.4 (Release date: 2020-03-24)
footnote Full support
Samsung Internet – Full support
Samsung Internet 12 (Release date: 2020-06-19)
footnote Full support
WebView Android – Full support
WebView Android 77 (Release date: 2019-09-10)
footnote Full support
WebView on iOS – Full support
WebView on iOS 13.4 (Release date: 2020-03-24)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

See also