<input type="file" multiple />
<div class="output"></div>FileList: length property / notebook
FileList: length property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const fileInput = document.querySelector("input[type=file]");
const output = document.querySelector(".output");
fileInput.addEventListener("change", () => {
const fileList = fileInput.files;
output.textContent = `You've selected: ${fileList.length} file(s)`;
});