Javascripts > Javascript Forms > Clear Form onFocus
Script Title: Clear Form onFocus
Description: This script clears the content out of a form field onFocus().
Example: Available
Copy the following code into your <HEAD></HEAD> tags.<script> <!-- function clearForm() { document.myForm.myField.value = ""; } //--> </script>
Copy the following code between the <BODY></BODY> tags of your html page.<form name="myForm"> <input type="text" name="myField" value="Click me!" onFocus="clearForm()"> </form>
Enter your name and email address to have this script sent right to your Inbox for later viewing. First Name Last Name Email