Created
January 14, 2013 20:46
-
-
Save norberttech/4533266 to your computer and use it in GitHub Desktop.
Placeholder.js fast usage.
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
window.onload = function() { | |
var form = document.getElementById('form'), | |
placeholderTestElm = document.createElement('input'), | |
isSupported = !(undefined === placeholderTestElm.placeholder); | |
if (!isSupported) { | |
this.initPlaceholder(); | |
form.onsubmit = function(e) { | |
alert('After this point all inputs without values and with placeholder should be clear.'); | |
} | |
} else { | |
alert('Sorry but the browser you are currently using have native placeholder support implemented. Try with older one.') | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment