cut

警告: This page needs to be updated to match the currently specified behaviour. In the meantime please refer to the specification: https://www.w3.org/TR/clipboard-apis/#the-cut-action

cut 事件在将选中内容从文档中删除并将其添加到剪贴板后触发。

如果用户尝试对不可编辑内容执行剪切操作,则cut事件仍会触发,但事件对象不包含任何数据。

基本信息

规范

Clipboard

接口
ClipboardEvent
是否冒泡

Yes

可取消默认行为

Yes

目标对象
DefaultView, Document, Element
默认行为

None

属性

Property Type Description
target 只读 EventTarget 事件对象(DOM 树的顶层对象)。
type 只读 DOMString 事件的类型。
bubbles 只读 Boolean 事件是否冒泡。
cancelable 只读 Boolean 事件是否可以取消。
clipboardData 只读 DataTransfer 剪贴板的内容。不仅仅是文本,还有文件和图片。

规范

Specification
Clipboard API and events
# clipboard-event-cut
HTML Standard
# handler-oncut

浏览器兼容性

BCD tables only load in the browser

相关