0

I want to copy html response in clipboard automatically without clicking on button. I have tried but not succeeded like using javascript

var textarea = $("#Data");
textarea.select();
var successful = document.execCommand('copy');

But it returns false..

How to proceed?

I have read previous posts but it not helpful

Karan
  • 23
  • 5
  • 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) – root Apr 18 '16 at 12:59
  • @root I have read this post but not helpful.... i get var successful = document.execCommand('copy'); as false – Karan Apr 18 '16 at 13:00
  • Can u clarify in what situation would u want the copying to happen? – root Apr 19 '16 at 03:29

0 Answers0