JSFiddle - React, Tailwind, and code Playground

HTML

<!DOCTYPE html>
<div id="copyContent">Select this text and try to ctrl-C</div>
<div id="copyResult"></div>

<script>

function copyEventHandler(event) {
  
  document.getElementById('copyResult').innerText = 'success: copy event on text was triggered';
}

document.getElementById('copyContent').addEventListener('copy', copyEventHandler, false);
</script>