Source Code:
(back to article)
Submit
Result:
Report an issue
<input type="file" id="fileInput" /> <div id="fileInfo"></div> <script> document.getElementById('fileInput').addEventListener('change', function(event) { const file = event.target.files[0]; const info = `File Name: ${file.name} <br> File Size: ${file.size} bytes<br> File Type: ${file.type}`; document.getElementById('fileInfo').innerHTML = info; }); </script>