0

I have a button in HTML page (SAFARI BROWSER), and I need to copy the text in a textbox to the clipboard on clicking that button without using flash.

In my scenario I should not select the text and give copy. Just by clicking the button autocopy should occur. Is that possible? If yes, how?

I used window.clipboardData, but it is returning undefined.

document.execCommand('copy') also wont work.

I have to copy without manually hitting ctrl+c or command+c.

Martin Evans
  • 45,791
  • 17
  • 81
  • 97
Manobala
  • 21
  • 1
  • 4
  • 1
    Possible duplicate of [How do I copy to the clipboard in JavaScript?](http://stackoverflow.com/questions/400212/how-do-i-copy-to-the-clipboard-in-javascript) – Tdelang Feb 29 '16 at 07:25
  • 1
    Thanks for your response. Yeah..But they dont have any working solution. I need a solution. – Manobala Feb 29 '16 at 07:35

0 Answers0