title: Using document.execCommand('copy') in mobile
body: <p>Is there a way to copy to mobile clipboard? I've been researching for days but haven't found a good solution. Clipboard.js doesn't seem to work on mobile, giving me an error "no support :("</p>
  
  <p>I'm currently using the following function:</p>
  
  <pre><code>function copytext(text) {
      var textField = document.createElement('textarea');
      textField.innerText = text;
      document.body.appendChild(textField);
      textField.select();
      document.execCommand('copy');
      textField.remove();
  }
  </code></pre>
  
  <p>Works like a charm on chrome on my desktop. But on chrome mobile, nothing gets copied. </p>
  
  <p>Is there a solution out there?</p>