In JavaScript can I make a "click" event fire programmatically for a file input element?

Posted by gregory.bell on Stack Overflow See other posts from Stack Overflow or by gregory.bell
Published on 2008-10-16T23:30:36Z Indexed on 2010/06/12 21:43 UTC
Read the original article Hit count: 253

Filed under:
|
|

I'd like to make a click event fire on an <input type="file"> tag programmatically.

Just calling click() doesn't seem to do anything or at least it doesn't pop up a file selection dialog.

I've been experimenting with capturing events using listeners and redirecting the event, but I haven't been able to get that to actually perform the event like someone clicked on it.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about html