Posted By

phiqle on 02/06/12


Tagged

input text fields Blur


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

BrockSamsom


Input text field hint with blur listener


 / Published in: jQuery
 

If input value has no value, return to originally input value.

  1. var $inputText = $('input[type="text"]');
  2.  
  3. $inputText.blur(function(){
  4.  
  5. if($(this).val() == ''){
  6.  
  7. $(this).attr('value', $inputText.val() );
  8.  
  9. }
  10. });

Report this snippet  

You need to login to post a comment.