I need to add onclick
event to an image so when I click on the image it will trigger the file open dialog. But it doesn't work in IE10.
$("#button").on("click",function(){
$("#upload").trigger("click");
});
#upload{
opacity: 0;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<img id="button" src="http://www.kafkabrigade.org.uk/wp-content/uploads/2011/07/button-pic.jpg" />
<input id="upload" type="file" >