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

前端 未结 28 1338
囚心锁ツ
囚心锁ツ 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:45

    just use a label tag, that way you can hide the input, and make it work through its related label https://developer.mozilla.org/fr/docs/Web/HTML/Element/Label

提交回复
热议问题