代码示例:(标识:event_oncopy_img)
<!DOCTYPE html>
<html>
<body>

<p>请尝试复制下面的图像。</p>

<img src="/logo.png" oncopy="myFunction()" width="188" height="267">

<p><b>注释:</b>此例在某些浏览器中可能无法按预期工作。</p>

<script>
function myFunction() {
  alert("You copied image!");
}
</script>

</body>
</html>
运行结果: