oncutEvent
Examples
Execute JavaScript when the selected content in an <input> element is cut:
Try it Yourself »
See more examples at the bottom of this article.
Definition and Usage
The oncut event triggers when the user cuts the content of an element.
Note:Although all HTML elements support the oncut event, in reality not all elements support it, for example <p> elements, unless contenteditable is set to "true" (see more examples below).
Tip:The oncut event is typically applied to <input> elements with type="text".
Tip:There are three ways to cut content:
- Press CTRL + X
- Select "Cut" from the browser's edit menu
- Right-click the mouse button and select the "Cut" command from the context menu.
Browser Support
| Event | |||||
|---|---|---|---|---|---|
| oncut | Yes | Yes | Yes | Yes | Yes |
Syntax
In HTML:
In JavaScript:
In JavaScript, using the addEventListener() method:
Note:Internet Explorer 8 and earlier IE versions do not supportaddEventListener()method.
Technical Details
| Bubbles: | Yes |
|---|---|
| Cancelable: | Yes |
| Event type: | ClipboardEvent |
| Supported HTML tags: | All HTML elements |

More Examples
Example
Execute JavaScript when cutting text content on a <p> element (note that contenteditable is set to "true"):
Try it Yourself »
Related Pages
HTML DOM Reference:oncopy Event
HTML DOM Reference:onpaste Event
Event Object Other Extensions