Is there a way to copy to a mobile clipboard? I have been researching for several days, but have not found a good solution. Clipboard.js doesn't seem to work on mobile devices, giving me the error "no support :("
I am currently using the following function:
function copytext(text) { var textField = document.createElement('textarea'); textField.innerText = text; document.body.appendChild(textField); textField.select(); document.execCommand('copy'); textField.remove(); }
Works like a charm on chrome on my desktop. But on chrome mobile nothing is copied.
Is there a solution there?
source share