Textarea.select() : TextArea : Form JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Form » TextArea »

 

Textarea.select()







The select() method selects the text in the text area.












<html>
    <head>
    <script language="JavaScript">
    <!--
    function selectText(){
      document.myForm.myTextArea.select();
      document.myForm.myTextArea.focus();
    }
    -->
    </script>
    </head>
    <body>
    <form name="myForm">
      <textarea name="myTextArea" rows=cols=50>
      Here is some text in my text area.
      </textarea>
    <input type=BUTTON value="Click to Select Text" name="myButton" onClick="selectText()">
    </form>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Form
» TextArea