title: Uncaught TypeError: item.getData is not a function
body: <p>I want to paste the clipboard content on html page. The content is copied from an ms-word file. Contains text and images. Consider the following code:</p>
  
  <pre><code>&lt;div id="pasteArea" contenteditable="True"&gt;&lt;/div&gt;
  &lt;script type="text/javascript"&gt;
      var pasteArea = document.getElementById('pasteArea');
      pasteArea.onpaste = function (event) {
          event.preventDefault();
          event.stopPropagation();
          var items = (event.clipboardData || event.originalEvent.clipboardData).items;
          for (index in items) {
              var item = items[index];
              if(item.kind === 'string'){
                  console.log(item.getData('text'));
                  // Getting the error in here!
              }
              else if(item.kind === 'file'){
                  // Code for handling images
              }
          }
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>I tried using <code>event.clipboardData.getData('text');</code> but it fetches the entire text (i.e. skips the images in between) and also the text formatting is lost.</p>
  
  <p>Any idea on how to handle the above case? Thank you.</p>