title: Remove button for each image thumbnail preview
body: <p><img src="https://i.stack.imgur.com/Vg0Jn.jpg" alt="remove button in each thumbnail"></p>
  
  <p>hello, i need your help for my codes. I want to preview multiple images before upload and there are remove button in each images. But my code doesn't work when i'm using div targetting in each remove button.</p>
  
  <p>the first, my codes is like <a href="http://jsfiddle.net/vdp1708/L45LW/1/" rel="nofollow noreferrer">THIS FIDDLE 1</a>.
  and when i'm add some changes become <a href="http://jsfiddle.net/vdp1708/L45LW/2/" rel="nofollow noreferrer">THIS FIDDLE 2</a></p>
  
  <p>my HTML :</p>
  
  <pre><code>&lt;body&gt;
  &lt;header&gt;
      &lt;h1&gt;File API - FileReader&lt;/h1&gt;
  &lt;/header&gt;
  &lt;article&gt;
      &lt;label for="files"&gt;Select multiple files: &lt;/label&gt;
      &lt;input id="files" type="file" multiple/&gt;
      &lt;output id="result" /&gt;
  &lt;/article&gt;
  </code></pre>
  
  <p>and CSS : </p>
  
  <pre><code>body{
  font-family: 'Segoe UI';
  font-size: 12pt;
  }
  
  header h1{
  font-size:12pt;
  color: #fff;
  background-color: #1BA1E2;
  padding: 20px;
  
   }
   article
  {
  width: 80%;
  margin:auto;
  margin-top:10px;
  }
  
  
   .thumbnail{
  
  height: 100px;
  margin: 10px;    
  }
  </code></pre>
  
  <p>it's my javascripts :</p>
  
  <pre><code> window.onload = function(){
  
  //Check File API support
  if(window.File &amp;&amp; window.FileList &amp;&amp; window.FileReader)
  {
      var filesInput = document.getElementById("files");
  
      filesInput.addEventListener("change", function(event){
  
          var files = event.target.files; //FileList object
          var output = document.getElementById("result");
  
          for(var i = 0; i&lt; files.length; i++)
          {
              var file = files[i];
  
              //Only pics
              if(!file.type.match('image'))
                continue;
  
              var picReader = new FileReader();
  
              picReader.addEventListener("load",function(event){
  
                  var picFile = event.target;
  
                  var div = document.createElement("div");
  
                  div.innerHTML = "&lt;img class='thumbnail' src='" + picFile.result + "'" +
                          "title='" + picFile.name + "'/&gt; &lt;a href='#' class='remove_pict'&gt;X&lt;/a&gt;";
  
                  output.insertBefore(div,null);            
  
              });
  
               //Read the image
              picReader.readAsDataURL(file);
          }                               
  
      });
  }
  else
  {
      console.log("Your browser does not support File API");
  }
  }
  </code></pre>
  
  <p>thanks for advance. any suggestions much be appreciated ^^</p>