title: delete input select image preview using jQuery
body: <p>I add image preview/delete before upload using jquery like this :</p>
  
  <p>HTML is Here:</p>
  
  <pre><code>&lt;input type='file' id='input1'&gt;
  &lt;img id='imagepreview1' src="http://placehold.it/100x100" /&gt;
  </code></pre>
  
  <p>JS is Here:</p>
  
  <pre><code>function readURL(input) {
      if (input.files &amp;&amp; input.files[0]) {
          var reader = new FileReader();
  
          reader.onload = function (e) {
              $('#imagepreview1').prop('src', e.target.result).show().addClass('selected');
          }
  
          reader.readAsDataURL(input.files[0]);
      }
  }
  
  $("#input1").change(function () {
      readURL(this);
      $('#imagepreview1').show();
  });
  
  var orig_src = $('#imagepreview1').prop('src');
  
  $('#imagepreview1').click(function () {
      $('#input1').replaceWith($('#input1').clone(true));
      $('#imagepreview1').not('.selected').hide();
      $('#imagepreview1.selected').prop('src', orig_src).removeClass('selected');
  });
  </code></pre>
  
  <p>Now, when I remove image with click this image input selected not remove and post data from my form. ho do can remove input select when I remove image?</p>
  
  <p>Problem PIC (when I remove image and show preview):</p>
  
  <p><img src="https://i.stack.imgur.com/L4Ocj.jpg" alt="enter image description here"></p>
  
  <p>NOTE: <strong>(I check In FF not worked)</strong></p>
  
  <p>DEMO HERE: <a href="http://jsfiddle.net/mkGSY/" rel="nofollow noreferrer">http://jsfiddle.net/mkGSY/</a></p>