title: How to get the filename from input type=file html element using JavaScript or JQuery?
body: <p>In Google Chrome browser, i have tried several way + following and none is giving me the value of the file name which was attached, after validation i will submit the file. But always its undefined or val() does not found..</p>
  
  <p>How to resolve it?</p>
  
  <pre><code>console.log($("input[name='attachment[]']"));
  /* Output:
  [
  &lt;input type=​"file" name=​"attachment[]​" id=​"attachment"&gt;​
  , 
  &lt;input type=​"file" name=​"attachment[]​" id=​"attachment"&gt;​
  , 
  &lt;input type=​"file" name=​"attachment[]​" id=​"attachment"&gt;​
  ]
  */
  
  $.each($("input[name='attachment[]']"), function(i,v) {
      console.log(i);
      console.log(v); //v.val() does not exist... even uploaded a file and showing file
  
  });
  
  /* Output: 
  0
  &lt;input type=​"file" name=​"attachment[]​" id=​"attachment"&gt;​
  1
  &lt;input type=​"file" name=​"attachment[]​" id=​"attachment"&gt;​
  2
  &lt;input type=​"file" name=​"attachment[]​" id=​"attachment"&gt;​
  */
  
  return false;
  </code></pre>