I want to show the file dialog once the page is loaded. I tried using JS to trigger the click event on the file input in jQuery document ready event. But this approach only works in IE11, it doesn't work in Chrome (41.0.2272.118). How can I make it work in Chrome?
Here is my code which doesn't work in Chrome but work in IE:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My HTML File</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
</head>
<body >
<input type="file" id="a" />
<script>
$(document).ready(function () {
Go();
});
function Go() {
var input = $('input');
input.click();
console.log('Gooooooooooooooo');
}
</script>
</body>
</html>