Created
July 25, 2017 20:27
-
-
Save thiamsantos/85c312e0695ab7dcc2214d30fe249739 to your computer and use it in GitHub Desktop.
check if browser support input type date
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 supportInputDate() { | |
const type = 'date' | |
const smile = '1)' | |
const inputElement = document.createElement('input') | |
inputElement.setAttribute('type', type) | |
inputElement.value = smile | |
inputElement.value !== smile | |
return inputElement.type === 'date' && inputElement.value !== smile | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment