title: Paste Image using Javascript onpaste is not working for IE, working with chrome
body: <p>I am trying to save a image/screenshot through paste <kbd>Ctrl</kbd>+<kbd>V</kbd> into a div <code>#pasteImageDiv</code> by user. Its working fine with Chrome but not working with IE.</p>
  
  <p>I am using IE10. </p>
  
  <p>Until now, what I have been able to find is that if I paste any text to div #pasteImageDiv, it catch the <code>onpaste</code> event properly, even in IE.
  But if I paste an image instead of text, it even doesn't catch <code>onpaste</code> (IE doesn't even enter into the function that handles the <code>onpaste</code> event). </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>document.getElementById('pasteImageDiv').onpaste = function (event) {</code></pre>
  </div>
  </div>
  </p>
  
  <p>It is working well in Chrome whether I paste a text string or an image.
  I hope you understand what kind of issue I am facing. Still, if any additional information is needed, please let me know.</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> $('#pasteImageHere, #pasteImageDiv').click(function(e){ //on paste image button click
     e.preventDefault();
     $('#hideOnPaste').hide();
     //document.getElementById('pasteImageDiv').click();
    document.getElementById('pasteImageDiv').style.backgroundColor = "#F1F1F1";
    document.getElementById('pasteImageDiv').onpaste = function (event) {
      $('#hideOnPaste').hide();
      //console.log(event.clipboardData.getData('image/png'));
       // use event.originalEvent.clipboard for newer chrome versions
       var items = (event.clipboardData  || event.originalEvent.clipboardData).items;
       console.log(JSON.stringify(items)); // will give you the mime types
       // find pasted image among pasted items
       var blob = null;
       for (var i = 0; i &lt; items.length; i++) {
      if (items[i].type.indexOf("image") === 0) {
        blob = items[i].getAsFile();
      }
       }
       // load image if there is a pasted image
       if (blob !== null) {
      var reader = new FileReader();
      reader.onload = function(event) {
        console.log(event.target.result); // data url!
        var elem = document.createElement("img");
        elem.setAttribute("id", "pastedImage");
        elem.setAttribute("height", "200");
        elem.setAttribute("width", "300");
        document.getElementById("pasteImageDiv").appendChild(elem);
        document.getElementById("pastedImage").src = event.target.result;
        document.getElementById('inputImageData').value = event.target.result;
        console.log($('#inputImageData').val());
        $('#pastedImage').css('width', '300px');
        $('#pastedImage').css('height', '200px');
        document.getElementById("pastedImage").style.height = '200px';
      };
      reader.readAsDataURL(blob);
      $('#removePastedImage').show();
       }
       
     }
   
    });</code></pre>
  </div>
  </div>
  </p>