how to fire event on file select

前端 未结 7 1045
遥遥无期
遥遥无期 2020-12-02 15:25

I\'ve a form as

7条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-02 15:40

    You could subscribe for the onchange event on the input field:

    
    

    and then:

    document.getElementById('file').onchange = function() {
        // fire the upload here
    };
    

提交回复
热议问题