Remove text on focus change in form?

I want the Keywords and Location text to disappear when a Visitor clicks in the respective field.

What's the conventional approach?
Who is Participating?
Jagadishwor DulalConnect With a Mentor Braces MediaCommented:
How do you applying this text? if you are using html5 tags and used placeholder then it will be disappear when you click on like:

<input type="text" name="Keywords" id="Keywords" placeholder="Keywords" />

Open in new window

Otherwise you can use a simple javascript to Manage like:
<input type="text"  onblur="if(this.value=='')this.value='Keywords';" onfocus="if(this.value=='Keywords')this.value='';" value="Keywords" id="Keywords" name="Keywords">

Open in new window

you may want to use script that using the
<script ...>
Codes here

instead of using in-line script :)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.