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
  • 6,582
  • 17
  • 52
  • 105

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,781
  • 17
  • 25