Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

HTML | DOM Textarea select() Method

  • Last Updated : 22 Jan, 2019

The select() method in HTML DOM is used to select the entire content of text area or in a <input> element that includes a text field.


Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

Parameters: This method does not accept any parameters.

Return Value: It does not return any value.


<!DOCTYPE html>
            DOM Textarea select() Method
        <h1 style="color: green;">
            Textarea select() Method
        <textarea type = "text" 
            id = "text">Welcome to GeeksforGeeks
        <button onclick = "Geeks()">
            Select text
            function Geeks() {
                var doc = document.getElementById('text');

Before click on the button:
After click on the button:

Supported Browsers: The browser supported by DOM textarea select() method are listed below:

  • Apple Safari
  • Google Chrome
  • Firefox
  • Opera
  • Internet Explorer

My Personal Notes arrow_drop_up
Recommended Articles
Page :