title: display input type=file at multiple place in a form
body: <p>In my form there are several places where I need to upload image &amp; display the same
  so how can I do the same please help</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function previewImage(){
      var file = document.getElementById("file").files;
      var fileReader = new FileReader();
      fileReader.onload = function(event){
          document.getElementById("display").setAttribute("src", event.target.result);
      }
      fileReader.readAsDataURL(file[0])
  };</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;input type="file" id="file" accept="image/*" onchange="previewImage();"&gt;
  &lt;img id="display" class="w-50"&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>the html code is multiple time in my code calling the same function but it display only at first input field.</p>