JSFiddle - React, Tailwind, and code Playground
HTML
<div name="" id="original">
Load transcript in here.
</div>
<textarea name="" id="copied" cols="30" rows="10"></textarea>
JavaScript
var text = '';
function copyText(e) {
text = (document.all) ? document.selection.createRange().text : document.getSelection();
document.getElementById('copied').value = text;
}
document.onmouseup = copyText;
if (!document.all) {
document.captureEvents(Event.MOUSEUP);
}