Input File Click Chrome

后端 未结 2 1945
名媛妹妹
名媛妹妹 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:22

    You should wrap file-input element to other (ex.:div): HTTM:

    CSS:

    div{
    height:1px;
    overflow: hidden;
    }
    

    JS:

    $('div input').click();
    

    Good luck...

提交回复
热议问题