Last active
August 29, 2015 14:18
-
-
Save jweisber/df16d8956b2e08b3de4e to your computer and use it in GitHub Desktop.
Workaround for IE 10/11 textarea placeholder bug
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
// Work around a bug in IE 10/11: http://tinyurl.com/qykro7d | |
// The bug makes any empty textarea's placeholder its value. | |
// We undo that wherever it's happened. | |
jQuery(function() { | |
$('textarea').each(function() { | |
if ($(this).val() === $(this).attr('placeholder')) { | |
$(this).val(''); | |
} | |
}); | |
}); |
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
# Same thing in coffeescript | |
jQuery -> | |
$('textarea').each -> | |
if $(this).val() == $(this).attr('placeholder') | |
$(this).val '' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment