Mega Code Archive

 
Categories / JavaScript Tutorial / Form
 

Text blur()

The blur() method removes focus from the text box. <html>     <head>     <script language="JavaScript">     <!--     function removeFocus(){       document.myForm.myText.blur();     }     -->     </script>     </head>     <body>     <b>Highlight some of the text in the following text box:</b>     <P>     <form name="myForm">       <input type=TEXT value="hello world" name="myText">       <input type=BUTTON value="Click to Remove Focus" name="myButton"              onClick="removeFocus()">     </form>     </body>     </html>