html5 - What is the Javascript Equivalent of A User Clicking on the Input Type File Button? -
what need programmatically hook file select dialog created when user clicks on button input type file, without user clicking on button. javascript test if file exists, , handle needed: read it, copy it, etc.
try utilizing onchange
event access file
object if user selects file ; js
cannot select user file .
var input = document.queryselector("[type=file]"); input.onchange = function() { console.log(this.files) }
<input type="file" />
Comments
Post a Comment