Created
February 18, 2015 14:42
-
-
Save thotbox/bcb894bf87b196d0d93f to your computer and use it in GitHub Desktop.
Placeholder Focus Kill
This file contains hidden or 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
// Placeholder Focus Kill | |
$('.has-placeholder').on('focus', function() { | |
var $field = $(this); | |
$field.attr({placeholderinactive : $field.attr('placeholder')}).removeAttr('placeholder'); | |
}); | |
$('.has-placeholder').on('blur', function() { | |
var $field = $(this); | |
$field.attr({placeholder : $field.attr('placeholderinactive')}).removeAttr('placeholderinactive'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment