I need to know more about your use case to give the best advice but initially, you may want to consider the implications of using display:none on the element - it will be an accessibility issue (although less so if this is strictly a mobile app). That being said, this seems like a case where you'd want to use something like 'visibility:hidden' or 'hidden' or http://snook.ca/archives/html_and_css/hiding-content-for-accessibility. That should make it accessible and it works on an android browser (stock browser for Galaxy s3, android 4.x).
Regarding why it doesn't work on the android browser - I don't know, maybe someone else can shed some light on it. On Wed, Dec 4, 2013 at 8:18 AM, chun zhang <[email protected]> wrote: > <!DOCTYPE html> > <html> > <head> > <script src=" > http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> > </script> > <script> > $(document).ready(function(){ > $("p").click(function(){ > $("#test").click(); > }); > }); > </script> > </head> > <body> > <p>If you click on me, I will disappear.</p> > <p>Click me away!</p> > <p>Click me too!</p> > <input id="test" type="file" style="display:none;"> > </body> > </html> > > Run this code on android browser, click p will never show file dialog. > But if I remove style="display:none;", let the input show, it works. > Why? > ______________________________________________________________________ > css-discuss [[email protected]] > http://www.css-discuss.org/mailman/listinfo/css-d > List wiki/FAQ -- http://css-discuss.incutio.com/ > List policies -- http://css-discuss.org/policies.html > Supported by evolt.org -- http://www.evolt.org/help_support_evolt/ > -- Chris Rockwell ______________________________________________________________________ css-discuss [[email protected]] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
