There seems to be no Modernizr solution here, but how can I detect support for a specific input type, not an attribute?
For example, for an attribute:
var supportsRequired = 'required' in document.createElement('input') if (supportsRequired) { // support } else { // no support }
Is there an easy way to do this using input types? One thing I donβt want to do is swap input type if it is not supported. Something like this to check only? ...
var supportsEmailType = 'email' in input.type if (supportsEmailType) { // support } else { // no support }
Any help was appreciated.
source share