Tag Archive | snippet

Clear Input Field on Focus

Use this code to style your input field with simple function

<input type="text" name="email" onfocus="if(this.value == 'email address') { this.value = ''; }" value="email address" onblur="if(this.value==''){this.value = 'email address';}" />

Replace “email address” with your own text.

Advertisements