Modify color placeholder


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



Copy this code and paste it in your HTML
  1. var textoPadrao = 'busca'
  2. $('#txtBusca').val(textoPadrao).css('color','#999')
  3. .focus(function(){
  4. if($(this).val() == textoPadrao){
  5. $(this).css('color','').val('');
  6. }
  7. }).blur(function(){
  8. if($(this).val() == ''){
  9. $(this).val(textoPadrao).css('color','#999')
  10. }
  11. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.