Posted By

Farhan on 08/26/10


Tagged

form input clearfield


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

koyotebr


Empty Form Field Onclick


 / Published in: JavaScript
 

  1. <input type="text" name="txt" id="txt" value="Name"
  2. onblur="if(this.value.length == 0) this.value='Name';" onclick="if(this.value == 'Name') this.value='';" />

Report this snippet  

You need to login to post a comment.