<!DOCTYPE html>
<html>
<body>

<p>This example uses the addEventListener() method to attach a "cut" event to an input element.</p>

<input type="text" id="myInput" value="Try to cut this text">

<script>
document.getElementById("myInput").addEventListener("cut", myFunction);

function myFunction() {
    alert("You cut text!");
}
</script>

</body>
</html>