0

I'm doing copy text when click on the button to copy the text from the text field. But not working on safari in Iphone This is my function

function myFunction() {
      var copyText = document.getElementById("myInput");
      copyText.select();
      document.execCommand("copy");
     }
  • Do you get any errors? Have you checked the value of each variable using Safari's developer tools? – Sven van de Scheur May 28 '19 at 15:17
  • A quick search brings up this : https://stackoverflow.com/questions/34045777/copy-to-clipboard-using-javascript-in-ios , seems there may be ios specific issues you need to work around for this. – Liam MacDonald May 28 '19 at 15:24

1 Answers1

0

Copy command works from iOS 10. I think you may not have the supported version. See here for browsers/iOS support Reference

Nirmala
  • 65
  • 2
  • 10