Posted By

touffies on 11/12/10


Tagged

input jquery focus placeholder


Versions (?)

Input Placeholder


 / Published in: jQuery
 

On focus, remove text inside input containing a title, put it back if it has not change

  1. $(function(){
  2. $("input[type*='text'][title]")
  3. .bind("focus",function(){ if(this.value==this.title){ this.value=""; } })
  4. .bind("blur",function(){ if(this.value==""){ this.value=this.title; } });
  5. });

Report this snippet  

You need to login to post a comment.