Input File Click Chrome

后端 未结 2 1960
名媛妹妹
名媛妹妹 2021-02-20 03:32

Ok so I have an input element of type file and id \"test\"

When I put in the address bar: javascript: document.getElementById(\"test\").click() it brings up the open fil

2条回答
  •  情深已故
    2021-02-20 04:02

    I had the same problem and managed to solve it(though I am using jQuery). I detailed the technique in another question

    Jquery trigger file input

    The idea was essentially to focus the file input before triggering the click programatically.

提交回复
热议问题