Javascripts > Javascript Forms > Clear Form Field Value on Click
Script Title: Clear Form Field Value on Click
Description: Clear the value in a form field when a user clicks into it.
Example: Available
Credit: Script created by Ada Shimar
Copy the following code into your <HEAD></HEAD> tags.<script> /* Clear default form value script- By Ada Shimar (ada@chalktv.com) */ function clearText(thefield){ if (thefield.defaultValue==thefield.value) thefield.value = "" } </script>
Copy the following code between the <BODY></BODY> tags of your html page.<form> <input type="text" value="Search this site" onFocus="clearText(this)"> </form>
Enter your name and email address to have this script sent right to your Inbox for later viewing. First Name Last Name Email