JSFiddle - React, Tailwind, and code Playground
HTML
<p>
Select this text and then paste into the textarea below.
</p>
<textarea class="lame">SUNDAY SUNDAY SUNDAY AT THE MOTORCROSS ARENA!!!!</textarea>
<textarea></textarea>
CSS
.lame {
z-index: -1;
opacity: 0;
}
JavaScript
document.querySelector('p').addEventListener('mouseup', function(ev) {
var test = document.querySelector('.lame');
var bkp = test.value;
test.select();
document.execCommand('cut');
test.value = bkp;
});