javascript - open FileSelect dialog programmatically -
I am trying to open a file select dialog box without contacting the user, but it does not work and I Do not understand why In this example, I am trying to open it from the window. Ollod function, but it does nothing. The console output shows that the "simulateclick ()" function is executed, but I do not see the dialog box. When I use the 'Test' button instead, it works fine. To make a call besides "document.getElementById ('files'). Click ()" There is no effect from the console. Can anyone explain? & lt; Html & gt; & Lt; Body & gt; & Lt; Input type = "file" id = "file" name = "files []" multiple & gt; & Lt; Input type = "button" id = "test" value = "test" & gt; & Lt; Script & gt; Function simulatorclick () {console.log ("first"); Var elem = document.getElementById ('file'); Console.log (ELEM); Elem.click (); Console.log...