![]() |
VOOZH | about |
The HTML DOM oncopy event occurs when the content of an element is copied by the user. It is also applicable to the image, created with the element. It is mostly used with type=βtextβ.
Note: There are three ways to copy the content of an element:
Supported Tags
Syntax:
In HTML:
<element oncopy="myScript">
In JavaScript:
object.oncopy = function(){myScript};
In JavaScript, using the addEventListener() method:
object.addEventListener("copy", myScript);
Example: Using HTML
Output:
Example: Using JavaScript
Output:
Example: In JavaScript, using the addEventListener() method:
Output:
Supported Browsers: The browsers supported by oncopy Event are listed below: