cut event is fired on an SVGGraphicsElement when the user has initiated a "cut" action through the browserʼs user interface.

If the user attempts a cut action on uneditable content, the cut event still fires but the event object contains no data.

冒泡 Yes
可取消 Yes
接口 ClipboardEvent
事件处理程序特性 oncut

The eventʼs default action is to copy the current selection (if any) to the system clipboard and remove it from the document.

A handler for this event can 修改 the clipboard contents by calling setData(format, data) on the event's ClipboardEvent.clipboardData property, and cancelling the default action using event.preventDefault() .

Note though that cancelling the default action will also prevent the document from being updated. So an event handler which wants to emulate the default action for "cut" while modifying the clipboard must also manually remove the selection from the document.

The handler cannot read the clipboard data.

It's possible to construct and dispatch a synthetic cut event, but this will not affect the system clipboard or the document's contents.

规范

规范 状态 注释
Scalable Vector Graphics (SVG) 2 候选推荐 Definition that the clipboard events apply to SVG elements.
Clipboard API and events 工作草案 初始定义

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.

No compatibility data found. Please contribute data for "api.SVGGraphicsElement.cut_event" (depth: 1) to the MDN 兼容性数据存储库 .

另请参阅

元数据

  • 最后修改: