Textarea.onSelect : TextArea : Form JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Form » TextArea »

 

Textarea.onSelect







The onSelect event handler is fired when the text in the area is highlighted.












<html>
    <head>
    <script language="JavaScript">
    <!--
    function setText(){
      document.myForm.myTextArea2.value = document.myForm.myTextArea1.defaultValue;
    }
    -->

    </script>
    </head>
    <body>
    <form name="myForm">
      <textarea name="myTextArea1" rows=cols=50 onSelect='setText()'>
      Here is some text in my text area.
      </textarea>
      <br>
      <textarea name="myTextArea2" rows=cols=50>
      </textarea>
    </form>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Form
» TextArea