<!DOCTYPE html>
<html>
<body>
<p>This example demonstrates how to assign an "onpaste" event to an input element.</p>
<input type="text" onpaste="myFunction()" value="Try to paste something in here" size="40">
<script>
function myFunction() {
alert("You pasted text!");
}
</script>
</body>
</html>