Favorites

HTML enterkeyhint Global Attribute

enterkeyhint
HTML Global AttributeThis global attribute is supported by all modern browsers.
Updated 22nd November 2026

The enterkeyhint attribute sets the label or icon of the Enter key on a virtual keyboard, such as Go, Next, Search, Send or Done.

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee

Description

The enterkeyhint attribute is a global HTML attribute that provides a hint to the browser about what action should be displayed on the virtual keyboard’s Enter key when the user is interacting with an input field or editable element. This attribute is particularly useful on touch devices, such as smartphones and tablets, where the virtual keyboard can change the label or icon of the Enter key to indicate the expected action.

By setting the enterkeyhint attribute, developers can improve user experience by suggesting the appropriate action for the input context, making forms and interactive elements more intuitive.

Use Cases

  1. Form Navigation: When filling out a multi-field form, using enterkeyhint="next" shows a "Next" label on the key. The attribute only changes the label: moving focus to the next field must still be handled with JavaScript, for example in a keydown handler.

  2. Messaging Applications: In a chat or messaging app, enterkeyhint="send" can replace the Enter key label with "Send," giving users a clear signal that pressing Enter sends their message.

  3. Search Bars: For a search input, enterkeyhint="search" informs the virtual keyboard to display a search-related key, improving the clarity of the action.

  4. Finalizing Input: If the input represents the final action, like confirming an order or submitting a form, enterkeyhint="done" communicates to the user that pressing Enter completes the task.

Example

<form>
  <label for="username">Username:</label>
  <input type="text" id="username" name="username" enterkeyhint="next">

  <label for="password">Password:</label>
  <input type="password" id="password" name="password" enterkeyhint="done">
  
  <button type="submit">Submit</button>
</form>

In this example:

  • The username input uses enterkeyhint="next", so the Enter key is labelled "Next". Pressing it still behaves like Enter unless a script moves the focus.
  • The password input uses enterkeyhint="done", signaling that the user has completed the form.

Syntax

<element enterkeyhint="value">

Values

  • enterDefault action. Indicates that the Enter key inserts a newline or submits the form.
  • doneSuggests that the input is complete and pressing Enter will finalize input.
  • goIndicates that pressing Enter will "go" or navigate, typically used for search or navigation inputs.
  • nextSuggests moving focus to the next input field.
  • previousSuggests moving focus to the previous input field.
  • searchIndicates a search action. Often displays a search icon on the keyboard.
  • sendIndicates sending a message or form submission.

Example

<form>
<label for="username">Username:</label>
<input type="text" id="username" name="username" enterkeyhint="next">
<br><br>
<label for="password">Password:</label>
<input type="password" id="password" name="password" enterkeyhint="done">

</form>
Open in editor

Browser Support

The following information will show you the current browser support for the HTML enterkeyhint global attribute. Hover over a browser icon to see the version that first introduced support for this HTML global attribute.

This global attribute is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee