<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)
  }
})

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.