html - Jquery open file search windows -


i have create simple button :

<button id="mybutton">search</button> 

i need open search file window when click on button. need behavior of input type file.

and don't want use input type file :)

any idea ? !

you can trigger click , listen #file change:

$(function(){     $('#mybutton').on('click', function(){        $("#file").trigger('click');      });     $("#file").on('change', function(){        console.log(this.value);     }); }); 

with this.value being filepath/file

check jsfiddle


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -