Name

HTMLInputElement.select( ) — select the contents of a Text element

Availability

DOM Level 1 HTML

Synopsis

void select(  );

Description

This method selects any text displayed in Text, Password, and FileUpload elements. In most browsers, this means that the user’s next keystroke will replace the current text rather than being appended to it.

Get JavaScript: The Definitive Guide, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.