docs.rodeo

MDN Web Docs mirror

HTMLElement: enterKeyHint property

{{APIRef("HTML DOM")}} 

The enterKeyHint property is an enumerated property defining what action label (or icon) to present for the enter key on virtual keyboards. It reflects the enterkeyhint HTML global attribute and is an enumerated property, only accepting the following values as a string:

If no enterKeyHint value has been specified or if it was set to a different value than the allowed ones, it will return an empty string.

Examples

Give a virtual keyboard a hint how to label the enter key (might render as Send and Search, depending on the OS or the user’s language).

const send = document.getElementById("sendInput");
const search = document.getElementById("searchInput");

send.enterKeyHint = "send";
search.enterKeyHint = "search";

Specifications

{{Specifications}} 

Browser compatibility

{{Compat}} 

See also

In this article

View on MDN