Clipboard events
The ClipboardEvent interface of the Clipboard API represents events providing information related to modification of the clipboard, that is cut, copy, and paste events.
Event ClipboardEvent
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 41 | 12 | 22 | 10.1 | 41 | 10.3 | |
| The clipboardData property of the ClipboardEvent interface holds a DataTransfer object, which can be used to: | 41 | 12 | 22 | 10.1 | 41 | 10.3 |
| The ClipboardEvent() constructor returns a new ClipboardEvent, representing an event providing information related to modification of the clipboard, that is Element/cutevent, Element/copyevent, and Element/paste_event events. | 58 | 17 | 22 | 10.1 | 58 | 10.3 |
| The copy event of the Clipboard API fires when the user initiates a copy action through the browser's user interface. | 1 | 12 | 22 | 3 | 18 | 3 |
| The cut event of the Clipboard API is fired when the user has initiated a "cut" action through the browser's user interface. | 1 | 12 | 22 | 3 | 18 | 3 |
| The paste event of the Clipboard API is fired when the user has initiated a "paste" action through the browser's user interface. | 1 | 12 | 22 | 3 | 18 | 3 |
- When pasting multiple files, only returns the first file. See bug 1954680.
- Before Firefox 140, when pasting multiple files, and the first file was not acceptable, returned no file. See bug 1961170.
Use cases
-
Using Clipboard events
The ClipboardEvent interface of the Clipboard API represents events providing information related to modification of the clipboard, that is cut, copy, and paste events.
Cautions
- May not be supported in older browsers.
Implementation notes
- Some APIs require a secure context (HTTPS) or user activation. Check the requirements before use.