Esta pรกgina foi traduzida do inglรชs pela comunidade. Saiba mais e junte-se ร  comunidade MDN Web Docs.

View in English Always switch to English

HTMLInputElement.select()

Baseline Widely available

This feature is well established and works across many devices and browser versions. Itโ€™s been available across browsers since โจjulho de 2015โฉ.

O mรฉtodo HTMLInputElement.select() seleciona todo o texto em um elemento <textarea> ou em um elemento <input> do tipo text.

Sintaxe

element.select()

Especificaรงรตes

Specification
HTML
# dom-textarea/input-select

Compatibilidade com navegadores

Notas

Executar element.select() nรฃo irรก necessariamente focar o input, por isso รฉ frequentemente usado em conjunto com HTMLElement.focus().

Veja tambรฉm