< input type= "file" > how to use js emulation to trigger a file selection pop-up box without clicking the trigger. (you can"t click on other elements either).
< input type= "file" > how to use js emulation to trigger a file selection pop-up box without clicking the trigger. (you can"t click on other elements either).
jquery triggers
$('input'). Click ()
can also be used natively
dom = document.getElementById (''). Click ();
) or
var event = document.createEvent ('MouseEvents')
event.initMouseEvent (' click',false,false)
dom.dispatchEvent (event)
<input type="file" id="upload">
var $input = document.querySelector('-sharpupload');
$input.onclick = function() {
console.log('a');
}
$input.click();
execute the above code in chrome, and the console will print out the contents of the console
statement, but will not pop up the window that selects the file. Execute document.querySelector ('- sharpupload'). Click ()
) directly in the console and the window will pop up.
there will be a message in firefox saying that a pop-up window is blocked, and if you choose allow, you will be able to pop up the window that selects the file.
this should be due to the browser's security considerations.
Previous: The old version of the rmp source could not be found on mysql's official website.
Next: Is there any other solution to the react project seo besides server-side rendering?
what is the current level of support for vw,vh layouts in mobile browsers? ...
Icon shows the red part. Choose how to write the effect in css ....
visual studio what plug-in allows CSS style codes to be displayed from least to more? sort out from least to most as shown in the following figure ...
this animation seems to be an animation with a height of 0 to 100%. How can it be realized? ...
$("-sharpadd_link").click(function(){ var link_html = "<div class= "linkAll_inn ">" + "<div class= "activity_theme ">" + ...
how is the style of CAPTCHA realized? how to find the principle! question: is there an input for each number? Find the solution ...
A table may have multiple pieces of data, and you can show a different number of entries by selecting different data to be displayed on each page, so here s the problem: I want to position the pages absolutely. Cannot be positioned relative to the brow...
the current project is compatible with laptops and desktops. but what is the size of the notebook? Notebook @ media how to write ...
step: 1. First, npm install webpack-g 2. Later, npm install webpack@1.15.0 was installed locally-- save-dev 3. Then execute webpack-v 4. Prompt: The CLI moved into a separate package: webpack-cli Would you like to install webpack-cli? (That will ...
the video will block the buttons below, ios, everything is fine, Android problems z-index is invalid absolute positioning is not valid nail built-in browser or is there an alternative to make the style look good ...
position:fixed;bottom: 0; perfect solution . It took me a long time to use height:100%;display:flex; align-self:end , found a position:fixed;bottom: 0; perfect solution I solved using height:100%;display:flex; align-self:end; *{ margin:...
because we are currently preparing the vw vh layout method and vertical screen application, but a horizontal screen equals to the exchange of vw and vh, and the interface is deformed. How to avoid this situation? ...
< el-upload class="upload-demo" ref="upload" action="http: localhost:8090 opus add" :data="mage" :on-exceed="handleE...
the figure is as follows: ...
...
adjust the font color according to the background color. When the blue background obscures the font, the color becomes white. Now it s half covered how to change the color of the font ...
this weird problem occurs with masks when out of focus. Appears only in iOS ...
the weather forecast is in the top navigation bar of the project. I don t know how to achieve this ...
these class libraries are designed to solve the 300ms delay and the emergence of point-through bug. when I first transferred to mobile development, I didn t think too much about it. I found several articles that mentioned these issues. The proposed s...
<div id="app"> <!----> <keep-alive> <router-view v-if="$route.meta.keepAlive">< router-view> < keep-alive> <router-view v-if="!$route.meta.keepAli...