I'm trying to call the click() method of a file input with a specific id, but the function call returns undefined and basically, nothing happens. I've replicated the situation here: http://jsfiddle.net/gkaG2/
It's very simple:
HTML
<input id="hiddenFileInput" type="file" multiple="multiple" accept="image/*" >
Javascript
document.getElementById('hiddenFileInput').click();
alert(document.getElementById('hiddenFileInput').click());
I try calling the click() method on the element, which doesn't work. I then call alert() to print what the function returns when it's called. It returns "undefined." I'm obviously doing something wrong, but what exactly?