Mega Code Archive

 
Categories / JavaScript Tutorial / Form
 

Textarea onChange

The onChange event handler is fired when the text in the area is modified. <html>     <head>     <script language="JavaScript">     <!--     function changeBack(){       document.myForm.myTextArea.value = document.myForm.myTextArea.defaultValue;     }     -->     </script>     </head>     <body>     <form name="myForm">       <textarea name="myTextArea" rows=2 cols=50 onChange='changeBack()'>       Here is some text in my text area.       </textarea>     </form>     </body>     </html>