Created
May 13, 2012 16:01
-
-
Save simontabor/2689048 to your computer and use it in GitHub Desktop.
Replaces all placeholders with values if placeholders aren't supported by the browser.
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
if (!Modernizr.input.placeholder) { | |
$('input').each(function() { | |
if ((!($(this).val())) && ($(this).attr('placeholder'))) { | |
$(this).val($(this).attr('placeholder')); | |
$(this).attr('onclick','this.value = ""'); | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment