My javascript – Copy text in the text field button doesn’t work on mobile devices, why?

This is the Javascript that does work on anything but mobile devices:

JAVASCRIPT:

function myFunction() {
var copyText = document.getElementById(“myInput”);
copyText.select();
document.execCommand(“copy”);
alert(“Copied the text: ” + copyText.value);
}

HTML5 in page:

Copy

What can I add to make this work on mobile devices? Thank you!

Read more here:: My javascript – Copy text in the text field button doesn’t work on mobile devices, why?

Leave a Reply

Your email address will not be published. Required fields are marked *