0
I have the following input:
<input type="file" accept="image/*" capture="camera" style="display:none" id="capturar">
I would like when loading the page to already open the field to select the file.
I tried the following, in jquery:
$(document).ready(function(e) {
$("#capturar").click();
});
But without result.
Some help ?
Have you tried replacing it with
$("#capturar").trigger('click');
? In some [browser] specific versions.click()
doesn’t work.– Hamurabi Araujo
Yes, even so does not open the field to select the file
– Pedro Augusto
@Stone for safety is unlikely, probably impossible, what you’re asking, which in case is to activate a
input type="file"
without the click event.– Thiago Santos
Here has several answers explaining why you won’t be able to do this!
– Marconi