This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
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.
Syntax
var clipboardEvent = 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
: ADOMString
containing the MIME-type of the data contained in thedata
argument.data
: ADOMString
containing the data concerned by the clipboard event.
Specifications
Specification | Status | Comment |
---|---|---|
Clipboard API and events The definition of 'ClipboardEvent()' in that specification. |
Working Draft | Initial definition. |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
ClipboardEvent() constructor | Chrome Full support 58 | Edge Full support ≤79 | Firefox Full support 22 | IE ? | Opera Full support 45 | Safari ? | WebView Android Full support 58 | Chrome Android Full support 58 | Firefox Android Full support 22 | Opera Android Full support 43 | Safari iOS ? | Samsung Internet Android Full support 7.0 |
Legend
- Full support
- Full support
- Compatibility unknown
- Compatibility unknown
- Experimental. Expect behavior to change in the future.
- Experimental. Expect behavior to change in the future.
See also
- Copy-related events:
copy
,cut
,paste
- The
ClipboardEvent
interface it belongs to. - Clipboard API