Posted By

erikportin on 06/01/11


Tagged

ie jquery


Versions (?)

jquery placeholder for forms in IE


 / Published in: JavaScript
 

  1. $(function() {
  2.  
  3. $("#emaillist input[type='text']").attr( 'value', 'enter email' );
  4.  
  5. $("#emaillist input[type='text']").focus(function () {
  6. var value = $("#emaillist input[type='text']").attr( 'value');
  7. if (value == 'enter email'){
  8. $(this).addClass('black');
  9. $("#emaillist input[type='text']").attr( 'value', '' );
  10. }
  11. });
  12.  
  13. $("#emaillist input[type='text']").focusout(function () {
  14. var value = $("#emaillist input[type='text']").attr( 'value');
  15. if (value == '' || value == 'enter email'){
  16. $(this).removeClass('black');
  17. $("#emaillist input[type='text']").attr( 'value', 'enter email' );
  18. }
  19. });
  20.  
  21. });

Report this snippet  

You need to login to post a comment.