The oncopy
attribute event is triggered
when copying the content of an element.
None.
<element oncopy="script or Javascript function name">
ALL HTML elements
oncopy |
Yes | Yes | Yes | Yes | Yes |
<!DOCTYPE html>
<html>
<body>
<!-- w w w .j av a 2 s. co m-->
<p oncopy="myFunction()">Copy me</p>
<script>
function myFunction() {
console.log("You copied text!");
}
</script>
</body>
</html>