Skip to content

Instantly share code, notes, and snippets.

@zmmbreeze
Created October 28, 2012 06:09
Show Gist options
  • Save zmmbreeze/3967845 to your computer and use it in GitHub Desktop.
Save zmmbreeze/3967845 to your computer and use it in GitHub Desktop.
Check input[type=file] support
var Util = {};
Util.supportInputFile = function() {
var input = document.createElement('input'),
support = false;
input.type = 'file';
// ios < 6, 会设置input为disabled
if (input.type === 'file' && !input.disabled) {
support = true;
}
this.supportInputFile = function() {
return support;
};
return support;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment