You are here: Reference > JavaScript > client-side > HTML DOM > methods > select (input, isindex, textarea)

select method (input, isindex, textarea)

Browser support:
Highlights the entire text in the element.
The selected element automatically gets the focus. A call to the select method fires the onselect and onfocus events.

Syntax: ( );
You can find the related objects in the Supported by objects section below.

Return value:

This method has no return value.

Example HTML code 1:

This example illustrates the use of the select method:
    <script type="text/javascript">
        function SelectInput () {
            var input = document.getElementById ("input");
    <input type="text" id="input" value="Type here!" />
    <button onclick="SelectInput ()">Select!</button>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content