1

I have a textarea tag and have a button. What I want is when I click the button, the text in that textarea will be copied into my clipboard.

I am using this in a Chrome Extension.

Thanks for any kind of help!

AGamePlayer
  • 7,404
  • 19
  • 62
  • 119

1 Answers1

-3

To copy text...

function CopyToClipboard(text) {
    Copied = text.createTextRange();
    Copied.execCommand("Copy");
}

To get the text...

textareaObject.value="text"
Community
  • 1
  • 1
Matt Olan
  • 1,911
  • 1
  • 18
  • 27