JSFiddle - React, Tailwind, and code Playground
HTML
<h3>
Highlight and copy me!
</h3>
<p>
Just testing to see What hAppens.
</p>
<textarea placeholder="Paste here" rows="4" cols="50"></textarea>
SCSS
h3 {
text-transform: uppercase;
}
JavaScript
$(document).on('copy', function(e){
var sel = window.getSelection();
var copiedText = sel.toString().toLowerCase().replace(/\b[a-z]/g, function(txtVal) { return txtVal.toUpperCase(); });
var copyHolder = $('<div>', { html: copiedText, style: { opacity: '0' }});
$('body').append(copyHolder);
sel.selectAllChildren( copyHolder[0] );
window.setTimeout(function() {
copyHolder.remove();
},0);
});