The ClipboardEvent() constructor returns a new ClipboardEvent, representing an event providing information related to modification of the clipboard, that is cut, copy, and paste events.
On this page
ClipboardEvent: ClipboardEvent() constructor
Syntax
js
new ClipboardEvent(type)
new ClipboardEvent(type, options)
Parameters
-
type -
A string with the name of the type of the
ClipboardEvent. It is case-sensitive and browsers set it tocopy,cut, orpaste. optionsOptional-
An object that, in addition of the properties defined in
Event(), has the following properties:clipboardDataOptional-
A
DataTransferobject containing the data concerned by the clipboard event. It defaults tonull. dataTypeNon-standard Optional-
A string containing the MIME-type of the data contained in the
dataargument. It defaults to"". dataNon-standard Optional-
A string containing the data concerned by the clipboard event. It defaults to
"".
Return value
A new ClipboardEvent object.
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 | |
ClipboardEvent |
58 | 17 | 22 | No | 45 | 10.1 | 58 | 58 | 22 | 43 | 10.3 | 7.0 |
See also
- Copy-related events:
copy,cut,paste - The
ClipboardEventinterface it belongs to. - Clipboard API
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/ClipboardEvent/ClipboardEvent