The copy
event fires when the user initiates a copy action through the browser's user interface.
The original target for this event is the Element
that was the intended target of the copy action. You can listen for this event on the Window
interface to handle it in the capture or bubbling phases. For full details on this event please see the page on the Element: copy event.
Syntax
Use the event name in methods like addEventListener()
, or set an event handler property.
addEventListener("copy", (event) => {});
oncopy = (event) => {};
Event type
Examples
window.addEventListener("copy", (event) => {
console.log("copy action initiated");
});
Specifications
Browser compatibility
|
Desktop |
Mobile |
|
Chrome |
Edge |
Firefox |
Internet Explorer |
Opera |
Safari |
WebView Android |
Chrome Android |
Firefox for Android |
Opera Android |
Safari on IOS |
Samsung Internet |
copy_event |
1 |
12 |
22 |
9Before Internet Explorer 9, this event is not supported via addEventListener ; however, the event handler is supported since IE 5.5. The event can be listened to via element.oncopy .
|
≤12.1 |
3 |
4.4 |
18 |
22 |
≤12.1 |
3 |
1.0 |
See also