Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h1>HTML DOM Events</h1>
<h2>The oncopy Event</h2>
<p>Use the HTML DOM to assign an oncopy event to an input element.</p>
<input type="text" id="myInput" oncopy="myFunction()" value="Try to copy me">
<p id="demo"></p>
<script>
document.getElementById("myInput").onpaste = function() {myFunction()};
function myFunction() {
  document.getElementById("demo").innerHTML = "You copied text!"
}
</script>
</body>
</html>