In JavaScript can I make a “click” event fire programmatically for a file input element?

前端 未结 28 1437
囚心锁ツ
囚心锁ツ 2020-11-21 06:29

I\'d like to make a click event fire on an tag programmatically.

Just calling click() doesn\'t seem to do anything or at lea

28条回答
  •  故里飘歌
    2020-11-21 06:50

    $(document).one('mousemove', function() { $(element).trigger('click') } );
    

    Worked for me when I ran into similar problem, it's a regular eRube Goldberg.

提交回复
热议问题