The ClipboardEvent()
constructor returns a newly created ClipboardEvent
, representing an event providing information related to modification of the clipboard, that is cut
, copy
, and paste
events.
ClipboardEvent()
Syntax
new ClipboardEvent(type) new ClipboardEvent(type, options)
Parameters
The ClipboardEvent()
constructor also inherits arguments from Event()
.
- type
-
Is a
DOMString
representing the name of the type of theClipboardEvent
. It is case-sensitive and can be:'copy'
,'cut'
, or'paste'
. - options Optional
-
Options are as follows:
-
clipboardData
: ADataTransfer
containing the data concerned by the clipboard event. -
dataType
Non-Standard : ADOMString
containing the MIME-type of the data contained in thedata
argument. -
data
Non-Standard : ADOMString
containing the data concerned by the clipboard event.
-
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
ClipboardEvent
interface it belongs to. - Clipboard API
© 2005–2021 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