Last active
August 29, 2015 14:27
-
-
Save sylouuu/11f9d6e424b65568a6ac to your computer and use it in GitHub Desktop.
Detect if an input type (HTML5) is supported
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
var isInputSupported = function (type) { | |
var i = document.createElement('input'); | |
i.setAttribute('type', type); | |
// The browser will replace your input type with text if not supported | |
return i.type !== 'text'; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment