Thursday, October 18, 2012

Clear input field on focus

Here is a simple way to clear html input field on focus.
<input type="text" 
onblur="if (this.value=='') 
this.value=this.defaultValue" 
onclick="if (this.defaultValue==this.value) this.value=''" 
value="Replace this with your value" 
name="nn">

No comments:

Post a Comment