enterkeyhint
The enterkeyhint global attribute suggests the label or action shown on the Enter key of a virtual keyboard, such as Next, Search, or Done.
What you will learn
- What the
enterkeyhintattribute changes - How to choose values such as
enter,next, andsearch - Why the key label is separate from the actual submit or newline behavior
Basic example
<input type="search" enterkeyhint="search">
<input type="text" enterkeyhint="next">
On supported virtual keyboards, the first field can show a Search action and the second can show a Next action. The attribute is a hint for the user interface; it does not by itself submit a form, move focus, or change a text area's newline behavior.
Common values
enter: insert or confirm an entry.done: finish the current input.next: move to the next field.search: start a search.send: send a message or form entry.
Choose the value that matches the action users should expect. Use JavaScript or form behavior separately when the action needs to actually happen.