যখন ব্যবহারকারী এলিমেন্টের টেক্সট পেস্ট করে, তখন HTML-এ onpaste অ্যাট্রিবিউটটি ট্রিগার হয়।
উদাহরণ
নিচের কোডটি চালিয়ে onpaste অ্যাট্রিবিউটের ব্যবহার দেখুন (মূল পাঠ্যে ভুলে pastes লেখা আছে):
<!DOCTYPE html> <html> <body> <input type = "text" onpaste = "display()" value = "Paste text here"> <h2 id = "test">Try to paste any text.</h2> <script> function display() { document.getElementById("test").innerHTML = "Your pasted text worked!"; } </script> </body> </html>