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 |
剪贴板的内容。不仅仅是文本,还有文件和图片。 |
浏览器兼容性
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help!
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|---|
Basic support | 58 | (Yes) | (Yes) | 未实现 | 45 | ? |
clipboardData |
58 | (Yes) | 22 (22) | 未实现 | 45 | ? |
Feature | Android Webview | Chrome for Android | Edge | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|---|
Basic support | 58 | 58 | (Yes) | (Yes) | ? | 45 | ? |
clipboardData |
58 | 58 | (Yes) | 22.0 (22) | ? | 45 | ? |
相关
HTMLElement.oncut
- Related events