The copy
event is fired when the user initiates a copy action through the browser UI (for example, using the CTRL/Cmd+C keyboard shortcut or selecting the "Copy" from the menu) and in response to an allowed {{domxref("Document.execCommand", "document.execCommand('copy')")}} call.
General info
- Specification
- Clipboard
- Interface
- {{domxref("ClipboardEvent")}}
- Bubbles
- Yes
- Cancelable
- Yes
- Target
- {{domxref("Element")}}: the focused element (for {{domxref("HTMLElement.contentEditable", "contentEditable")}} elements - the element containing the start of the selection), or the {{HTMLElement("body")}} element.
- Default Action
- Copies the selection to the clipboard
Properties
{{OpenEventProperties()}}{{CloseEventProperties()}}
Browser compatibility
{{ CompatibilityTable() }}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | {{ CompatVersionUnknown() }} | {{ CompatVersionUnknown() }} | {{ CompatUnknown() }} | {{ CompatUnknown() }} | {{ CompatUnknown() }} |
clipboardData |
{{ CompatVersionUnknown() }} | {{ CompatGeckoDesktop(22) }} | {{ CompatNo() }} | {{ CompatUnknown() }} | {{ CompatUnknown() }} |
Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | {{ CompatUnknown() }} | {{ CompatVersionUnknown() }} | {{ CompatUnknown() }} | {{ CompatUnknown() }} | {{ CompatUnknown() }} |
clipboardData |
{{ CompatUnknown() }} | {{ CompatGeckoMobile(22) }} | {{ CompatUnknown() }} | {{ CompatUnknown() }} | {{ CompatUnknown() }} |
Related events
- Copy-related events: {{CopyRelatedEvents()}}