Javascript examples for DOM HTML Element:Textarea
The select() method selects the contents of a text area.
None.
No return value.
The following code shows how to Select the contents of a text area:
<!DOCTYPE html> <html> <body> Address:<br> <textarea id="myTextarea"> test</textarea> <button type="button" onclick="myFunction()">Test</button> <script> function myFunction() {/*from ww w.jav a 2s. c o m*/ document.getElementById("myTextarea").select(); } </script> </body> </html>