{{APIRef("ClipboardEvent")}}{{SeeCompatTable}}
The ClipboardEvent()
constructor returns a newly created {{domxref("ClipboardEvent")}}, representing an event events providing information related to modification of the clipboard, that is {{event("cut")}}, {{event("copy")}}, and {{event("paste")}} events.
Syntax
clipboardEvent = new ClipboardEvent(type,
{dataType: aMimeType, data :someData
});
Arguments
The ClipboardEvent()
constructor also inherits arguments from {{domxref("Event.Event", "Event()")}}.
- type
-
Is a {{domxref("DOMString")}} representing the name of the type of the
ClipboardEvent
. It is case-sensitive and can be:'copy'
,'cut'
, or'paste'
. -
dataType
-
Is a {{domxref("DOMString")}} containing the MIME-type of the data contained in the
data
argument. -
data
- Is a {{domxref("DOMString")}} containing the data concerned by the clipboard event.
Specifications
Specification | Status | Comment |
---|---|---|
{{ SpecName('Clipboard API', '#idl-def-ClipboardEventInit', 'ClipboardEvent()') }} | {{ Spec2('Clipboard API') }} | Initial definition. |
Browser compatibility
{{ CompatibilityTable() }}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
See also
- Copy-related events: {{CopyRelatedEvents()}}
- The {{domxref("ClipboardEvent")}} interface it belongs to.