Posted By

dhjapan on 10/07/11


Tagged

login jquery


Versions (?)

JQuery, login/password fields


 / Published in: JavaScript
 

  1. $(document).ready(function(){
  2.  
  3. // Form : login
  4. $("input[name=login]")
  5. .blur( function() { if ($(this).val() == '' || $(this).val() == 'login') $(this).css('color', '#999').val('login'); } )
  6. .focus( function() { if ($(this).val() == 'login') $(this).css('color', '#fff').val(''); } )
  7. .trigger('blur')
  8. ;
  9. // Form : password
  10. $("input[name=pass]")
  11. .blur( function() { if ($(this).val() == '' || $(this).val() == 'password') $(this).css('color', '#999').val('password'); } )
  12. .focus( function() { if ($(this).val() == 'password') $(this).css('color', '#fff').val(''); } )
  13. .trigger('blur')
  14. ;
  15.  
  16. } );

Report this snippet  

You need to login to post a comment.