যখন ব্যবহারকারী উপাদানটির পাঠ্য কাটে, তখন অনকপি HTML এ অ্যাট্রিবিউট ট্রিগার।
উদাহরণ
আপনি অনকপি বাস্তবায়ন করতে নিম্নলিখিত কোড চালানোর চেষ্টা করতে পারেন বৈশিষ্ট্য −
<!DOCTYPE html>
<html>
<body>
<input type = "text" oncopy="display()" value = "Copy me">
<h2 id = "test">Try to copy the above text.</h2>
<script>
function display() {
document.getElementById("test").innerHTML = "Your copied text worked!";
}
</script>
</body>
</html>