Which browsers support the click event on the [type = "file"] tab?

According to https://developer.mozilla.org/en/Using_files_from_web_applications ,

Starting with Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1), you can hide the recognized ugly file element and present your own interface for opening the file collector and displaying the file or files that the user has selected.

With something like this (using jQuery):

$('a.upload').click(function(e) { e.preventDefault(); $('input[type="file"]').click(); }); 

I am not asking what other ways to make this better. I am wondering if other browsers support the click event for the input file in the same way?

+7
source share
2 answers

Firefox 3.2+ versions do not support AFAIK, because there is some security issue if the file input is hidden, chrome, etc. the support that I assume is that people trigger a click by pasting the input file directly behind fake items

+1
source

I checked a test that hides the original input file with the display: none and uses jQuery to fire the click event on the trigger button.

Works as a minimum: IE7 and later, FF 4.0 and later, Safari 4.0 and later (Win), Chrome 14.0 and later. Doesn't work: FF 3.6 and earlier.

0
source

All Articles