title: How to get the fileName in javascript from input file tag in IE browser
body: <p>I have done this in jQuery, to get filename from input file tag, With jQuery it works perfectly. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>//jQuery('input[type=file]').on('change', prepareUpload);
  
  document.getElementsByTagName('input[type=file]').addEventListener('change',prepareUpload1,true);
  
  /*
  //this works in jQuery 
  
  function prepareUpload(event)
  {
    var files = event.target.files;
    var fileName = files [0].name
  alert(fileName);
  }
  
  */
  
  /****Check it here ****/
  
  // it does not work in javascript 
  
  
  function prepareUpload1(event)
  {
    var files = event.target.files;
    var fileName = files [0].name
  alert("fileName 2 : "+fileName);
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;input type="file" /&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>But I found <a href="https://stackoverflow.com/a/10662927/1877909">Event.target does not work in IE</a>, I tried to change it to java script addeventlistener, it did not work. </p>
  
  <p>It throws error</p>
  
  <pre><code>Uncaught ReferenceError: input is not defined
  </code></pre>
  
  <p>It is working in jQuery but it is not working in JS, Due to IE issue I need to change it to JS.</p>
  
  <p>Can some one help </p>