{{ apiref("Clipboard API") }} {{SeeCompatTable}}
The ClipboardEvent.clipboardData
property holds a {{domxref("DataTransfer")}} object, which can be used:
- to specify what data should be put into the clipboard from the {{event("cut")}} and {{event("copy")}} event handlers, typically with a {{domxref("DataTransfer.setData", "setData(format, data)")}} call;
- to obtain the data to be pasted from the {{event("paste")}} event handler, typically with a {{domxref("DataTransfer.getData", "getData()")}} call.
See the {{event("cut")}}, {{event("copy")}}, and {{event("paste")}} documentation for more information.
Syntax
data = ClipboardEvent.clipboardData
Specifications
Specification | Status | Comment |
---|---|---|
{{ SpecName('Clipboard API', '#widl-ClipboardEvent-clipboardData', 'ClipboardEvent.clipboardData') }} | {{ Spec2('Clipboard API') }} | Initial definition. |
Browser compatibility
{{ CompatibilityTable() }}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatGeckoDesktop(22)}} | 5.0 | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatGeckoMobile(22)}} | 5.0 | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
See also
- Copy-related events: {{CopyRelatedEvents()}}
- The {{domxref("ClipboardEvent")}} interface it belongs to.