-
-
Save arielsalminen/5038024 to your computer and use it in GitHub Desktop.
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
function hasPlaceHolder() { | |
return 'placeholder' in document.createElement('input'); | |
} | |
function html5forms() { | |
var formPlaceholder = hasPlaceHolder(); | |
if (formPlaceholder === false) { | |
$('input[type=text]').each(function() { | |
if($(this).attr('placeholder')) { | |
var placeholderText = $(this).attr('placeholder'); | |
$(this).attr('value',placeholderText); | |
} | |
}); | |
emptyTextBox(); | |
} | |
} | |
document.addEventListener('DOMContentReady', html5forms, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment