Input Placeholder

/ Published in: jQuery
Save to your folder(s)

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

Copy this code and paste it in your HTML
  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


RSS Icon Subscribe to comments

You need to login to post a comment.