Mega Code Archive

 
Categories / JavaScript Tutorial / Form
 

Text value

The value property returns the current value of the text box. <html>     <head>     <script language="JavaScript">     <!--     function resetText(){       document.myForm.myText.value = document.myForm.myText.defaultValue;     }     -->     </script>     </head>     <body>     <form name="myForm">       <input type=TEXT value="First Box" name="myText">       <input type=BUTTON value="Reset" name="myButton" onClick='resetText()'>     </form>     </body>     </html>