This little javascript can be used to clear a form’s value when the user clicks on it.

Making a form clear when clicked

Add this code between the <head></head> tags on your page:

function clearText(thefield){ 
if (thefield.defaultValue==thefield.value) 
thefield.value = "" 

Once done you can now add your forms anywhere on the page and as many as you want like this:

Add this code between the body tags on your page:

<input type="text" value="Enter your e-mail address.." onFocus="clearText(this)"> 
<input type="text" value="Search this site.." onFocus="clearText(this)">


Web Hosting
Subscribe To Our Newsletter

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!