Textarea.onKeyPress : TextArea : Form JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Form » TextArea »

 

Textarea.onKeyPress







The onKeyPress event handler is fired when a key is pressed within the text area.












<html>
    <head>
    <script language="JavaScript1.2">
    <!--
    function showDialog(type){
      alert("An onKey" + type + " event just occurred");
    }
    -->
    </script>
    </head>
    <body>
    <form name="myForm">
      <textarea name="myTextArea" rows=cols=50
                onKeyDown='showDialog("Down")'
                onKeyPress='showDialog("Press")'>
      Here is some text in my text area.
      </textarea>
    </form>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Form
» TextArea