I need a solution to display open file dialog in HTML while clicking a div
. The open file dialog box must open when the div
is clicked.
I don't want to display the input file box as part of HTML page. It must be displayed in separate dialog, which is not a part of the web page.
$("#logo").css('opacity','0');
$("#select_logo").click(function(e){
e.preventDefault();
$("#logo").trigger('click');
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<a href="#" id="select_logo">Select Logo</a> <input type="file" id="logo">
for IE add this:
$("#logo").css('filter','alpha(opacity = 0');