HTMLInputElement.select()

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 Standard
# dom-textarea/input-select

Compatibilidade com navegadores

BCD tables only load in the browser

Notas

Executar element.select() não irá necessariamente focar o input, por isso é frequentemente usado em conjunto com HTMLElement.focus() (en-US).

Veja também