<input type="file" name="input" /> <script type="text/javascript"> window.onload = function(){ document.getElementsByName('input')[0].onchange = function(){ alert(this.value); }; }; </script>