0

copy on clipboard working in all browser but not working in safari code is

head>
    <title>copy test</title>
</head>
<body>
    <button onclick="copier()">Copy</button>
    <textarea id="myText">Copy me PLEASE!!!</textarea>

    <script>
        function copier(){
            document.getElementById('myText').select();
            document.execCommand('copy');
        }
    </script>
</body>
</html>

so for safari what i have to do please help me..thanks in advance.

Dksingh
  • 61
  • 1
  • 11

1 Answers1

0

This is for 'design mode' where the browser effectively turns the document into an editor. The execCommand API originated with IE and was later added to HTML5. Exactly which commands are supported, as well as their behavior varies across browsers. Clipboard access is considered a security risk.

please check this link

Community
  • 1
  • 1
Vitaly Menchikovsky
  • 7,684
  • 17
  • 57
  • 89