oncut event
Examples
JavaScript is executed when the <input> element in the choice of content is cut:
try it"
See more examples at the bottom of this article.
Definition and Usage
oncut event is triggered when the contents of the user shear element.
Note: While HTML elements use support oncut events, but in fact does not support all elements such as <p> element, unless the (See below for more examples) contenteditable as "true".
Tip: oncut event usually used in type = "text" of the <input> element.
Tip: There are three ways you can cut content:
- Press CTRL + X
- Select "Cut (Cut)" from your browser's Edit menu
- Right-click the mouse button to select "Cut (Cut)" command in the context menu.
Browser Support
event | |||||
---|---|---|---|---|---|
oncut | Yes | Yes | Yes | Yes | Yes |
grammar
In HTML:
In JavaScript:
JavaScript, use the addEventListener () method:
Note: Internet Explorer 8 and earlier versions of IE do not support addEventListener () method.
technical details
Whether to support the bubble: | Yes |
---|---|
It can be canceled: | Yes |
Event Type: | ClipboardEvent |
Supported HTML tags: | All HTML elements |
More examples
Examples
JavaScript is executed when the text Cut <p> element on (note contenteditable set to "true"):
try it"
Related Pages
HTML DOM Reference: oncopy event
HTML DOM Reference: onpaste event
Event objects