Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Input Text select() method

Input Text select() method

Input Text Object Reference The Input Text object

Example

Select the content of a text field:

document.getElementById("myText").select();

Try it »


Definition and Usage

The select() method is used to select the content in a text field.


Browser support

Internet Explorer Firefox Opera Google Chrome Safari

All major browsers support the select() method.


Syntax

textObject

.select()

Parameters

None.

Technical details

Return value: No return value

Input Text Object Reference The Input Text object