Javascript examples for DOM HTML Element:Image
Getting image file size in file input field
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <script type="text/javascript"> function handleFiles(files) { for (var i = 0; i < files.length; i++) {/*from ww w.j a v a 2 s .c o m*/ console.log(files[i].size + " Bytes"); } } function reset() {document.getElementById('file').value = '';} </script> <input id="file" type="file" onchange="handleFiles(this.files)" onmousedown="reset();"> </body> </html>