How do I know if it clicked open? [INPUT] [closed]

-2

Good People I was wondering if there is any way to know if the user clicked open there because I wanted to perform an action right after that. My goal is to execute an ajax request when the guy has clicked open ... I have a code here, but it does not fit that.

    
asked by anonymous 31.12.2017 / 05:19

1 answer

-2

Just create an escutador to execute some code when input is clicked and it will open the window to select a file:

$("#file").on("click", function(){
   alert("vai abrir a janela de selecionar arquivo");
   // insira aqui o código que deseja executar
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><inputtype="file" id="file" />
    
31.12.2017 / 05:48