<textarea id="text" hidden>text texttexttexttexttexttexttexttext</textarea>
function myFunction() {
var copyText = document.querySelector('#text');
copyText.select();
document.execCommand("copy");
copyText.value
}
myFunction();
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.