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!
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!
To copy text...
function CopyToClipboard(text) {
Copied = text.createTextRange();
Copied.execCommand("Copy");
}
To get the text...
textareaObject.value="text"