Often when creating forms on a website it is helpful to place descriptive text with some of the form fields to help the user understand what they should type in the box. If this descriptive text is not cleared automatically when the user begins to type, sometimes this will hinder them more than it helps.
Using a simple JavaScript function you can automatically clear the example values from the input box when the user clicks into the field.
For an example of how this works, look at my newsletter fields to the right.
This technique can easily be used to clear the contents of any input box.
All you have to do, is add a small bit of JavaScript to your input like this:
<input value="Your Comment" onclick="this.value=''" type="text">
There are a lot of other ways to do this… Post yours below.















