How to detect multiple files selection with touch screen on mobile devices
问题 I need to count the number of selected files during a multiple selection by clicking on a input type="file" element of a form. I'm writing the code on my laptop and everything is working fine with this code: function counter() { var inputUploader = document.querySelector('input[type="file"]'), chosenFiles = inputUploader.files, filesCount = chosenFiles.length > 1 ? chosenFiles.length : chosenFiles.length; alert(filesCount); } <form> <div> <input id="inputUploader" type="file" name="x"