Posted By

riddla on 10/07/10


Tagged

form javascript html default input forms Value field defaultvalue


Versions (?)

Who likes this?

9 people have marked this snippet as a favorite

riddla
luman
bobbym245
wazdesign
muzafarova
koyotebr
tcdesign
allproweb
guo3823538


Default value for input fields


 / Published in: JavaScript
 

In regards to progressive enhancement, see also the jQuery version.

  1. onfocus="if(this.value == this.defaultValue){ this.value='' };" onblur="if(this.value == ''){ this.value=this.defaultValue };"

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: tcdesign on October 17, 2010

Thanks works great :)

You need to login to post a comment.