Skip to content
Related Articles
Open in App
Not now

Related Articles

HTML | DOM Textarea select() Method

Improve Article
Save Article
  • Last Updated : 22 Jul, 2022
Improve Article
Save Article

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. 


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 1
  • Google Chrome 1
  • Edge 12
  • Firefox 1
  • Opera 12.1
  • Internet Explorer 5

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!