Skip to content

Instantly share code, notes, and snippets.

@fomigo
Created September 10, 2014 06:57
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 fomigo/154b33f4302224d3b556 to your computer and use it in GitHub Desktop.
Save fomigo/154b33f4302224d3b556 to your computer and use it in GitHub Desktop.
jQuery(document).ready(function() {
jQuery("input, textarea").each(function() {
jQuery(this).data('holder', jQuery(this).attr('placeholder'));
jQuery(this).focusin(function() {
jQuery(this).attr('placeholder', '');
});
jQuery(this).focusout(function() {
jQuery(this).attr('placeholder', jQuery(this).data('holder'));
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment