Text.onSelect : Text Object : Form JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Form » Text Object »

 

Text.onSelect







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












<html>
    <head>
    <script language="JavaScript">
    <!--
    function setText(){
      document.myForm.myText2.value = document.myForm.myText1.defaultValue;
    }
    -->
    </script>
    </head>
    <body>
    <form name="myForm">
      <input type=TEXT value="Change Me?" name="myText1" onSelect='setText()'>
      <br>
      <input type=TEXT value="" name="myText2">
    </form>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Form
» Text Object