Name

Input.select( ): select the text in a form element — DOM Level 2 HTML

Synopsis

void select( )

Description

The select( ) method selects the text displayed in an input element of type “text”, “password”, or “file”. The effects of selecting text may vary from platform to platform, but typically: the text is highlighted, it becomes available for cut and paste, and it is deleted if the user types another character.

Get JavaScript: The Definitive Guide, 5th 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.