How to Clear a Field on Focus using Javascript

To Clear a Field on Focus using Javascript you can use the following snippet.

Sample Javascript

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

Please Share us:
Please rate this snippet

5 thoughts on “How to Clear a Field on Focus using Javascript

Leave a Reply