Get the filename of the dragged-in file - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:children

Description

Get the filename of the dragged-in file

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-1.5.2.js"></script> 
      <script type="text/javascript">
    $(function(){//from   w w w  .jav  a  2 s  .c o  m

$('#foo').change(function () {
    console.log(this.value, $(this).val());
});
    });

      </script> 
   </head> 
   <body> 
      <input type="file" id="foo">  
   </body>
</html>

Related Tutorials