Last active
August 29, 2015 14:12
-
-
Save icetee/3ab91c9622ba81b98f7c to your computer and use it in GitHub Desktop.
HTML5 Placeholder disappear fix on focus
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('input:text, textarea').each(function(){ | |
var $this = $(this); | |
$this.data('placeholder', $this.attr('placeholder')) | |
.focus(function(){$this.removeAttr('placeholder');}) | |
.blur(function(){$this.attr('placeholder', $this.data('placeholder'));}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment