Trigger file input dialog

前端 未结 8 2058
忘了有多久
忘了有多久 2021-02-13 04:31

How can I auto trigger file input? ie. in the link below I want to trigger upload button on load

DEMO

8条回答
  •  天涯浪人
    2021-02-13 04:56

    
      
          

    Change your JS code like below.

    $("#test1 button").click(function() {
    $("#test").trigger('click');
    });
    

    Working Demo

提交回复
热议问题