<html>
<body>
<p>This example uses the HTML DOM to assign an "oncopy" event to an input element.</p>
<input type="text" id="myInput" value="Try to copy this text">
<script>
document.getElementById("myInput").oncopy = function() {myFunction()};
function myFunction() {
alert("You copied text!");
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_oncopy_dom by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:02:54 GMT -->
</html>