<input id="file" type="file" />
const fileInput = document.getElementById("file")
fileInput.addEventListener("change", evt => {
console.log(`${fileInput.length} file selected`)
console.log(fileInput.files.item(0))
for (let file of fileInput.files) {
console.log(file.name)
console.log(file.size)
}
})
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.