Skip to content

Instantly share code, notes, and snippets.

@nickwanhere
Last active December 19, 2015 23:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickwanhere/6037817 to your computer and use it in GitHub Desktop.
Save nickwanhere/6037817 to your computer and use it in GitHub Desktop.
ieplaceholder
jQuery(document).ready(function($) {
jQuery('input[placeholder]').each(function(){
var ph=jQuery(this).attr('placeholder');
if(jQuery(this).val()=='')
jQuery(this).val(ph);
jQuery(this).focus(function(){
if(jQuery(this).val()==ph)
jQuery(this).val('');
}).blur(function(){
if(jQuery(this).val()=='')
jQuery(this).val(ph);
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment