Posted By

gera3d on 09/24/10


Tagged

form


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

maltem
cjmling


Replace on Focus (form)


 / Published in: HTML
 

This just replaces the default value of a form element. Then it bring it back if you click away.

  1. <input type="text" value="Your Name" name="name" onblur="if (this.value == '') {this.value = 'Your Name';}" onfocus="if (this.value == 'Your Name') {this.value = '';}" />
  2. </form>

Report this snippet  

You need to login to post a comment.