I'm trying to trigger the button click event without having to actually click it. When the page is loaded I want to trigger the click event.
Here's the jsfidde link
<input type="file" id="test">
<button>Upload</button>
$(document).ready(function () {
$("button").click(function (e) {
$("#test").trigger('click');
});
$('button').trigger('click');
});