HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
The oncut attribute fires when the user cuts the content of an element."
The oncut
attribute fires when the user cuts the content of an element.
oncut
attribute is supported by all HTML
elements, it is not actually possible to cut the content of, for example, a
<p>
element, UNLESS the element has set the contenteditable
attribute to "true" (See "More Examples"
below).
The oncut
attribute is part of the Event Attributes, and can be used on any HTML elements.
Elements | Event |
---|---|
All HTML elements | oncut |
Execute a JavaScript when cutting some text in an <input> element:
<input type="text" oncut="myFunction()" value="Try to cut this text">
Execute a JavaScript when cutting some text of a <p> element (Note that contenteditable is set to "true"):
<p contenteditable="true" oncut="myFunction()">Try to cut this text</p>
Event Attribute | |||||
---|---|---|---|---|---|
oncut | Yes | Yes | Yes | Yes | Yes |