ClipboardEvent()

Experimental: 这是一个实验中的功能
此功能某些浏览器尚在开发中,请参考浏览器兼容性表格以得到在不同浏览器中适合使用的前缀。由于该功能对应的标准文档可能被重新修订,所以在未来版本的浏览器中该功能的语法和行为可能随之改变。

ClipboardEvent() 构造函数返回一个新建的 ClipboardEvent 对象,这个对象表示与修改剪切板相关的事件,这些事件包括 cutcopypaste 事件。

语法

var clipboardEvent = new ClipboardEvent(type[, options]);

参数

ClipboardEvent() 构造函数也从 Event() 继承参数。

type

一个 DOMString 字符串,描述了 ClipboardEvent 事件类型的名字,大小写敏感,可以是:'copy''cut'或者 'paste'

options 可选

选项如下:

  • clipboardData: 一个 DataTransfer containing the data concerned by the clipboard event.
  • dataType 非标准 : A DOMString containing the MIME-type of the data contained in the data argument.
  • data 非标准 : A DOMString containing the data concerned by the clipboard event.

规范

Specification
Clipboard API and events
# dom-clipboardevent-clipboardevent

浏览器兼容性

BCD tables only load in the browser

相关链接