HTML event attribute oncut








The oncut attribute event is triggered when cutting the content of an element.

What's new in HTML5

None.

Syntax

<element oncut="script or Javascript function name">

Supported Tags

ALL HTML elements

Browser compatibility

oncut Yes Yes Yes Yes Yes




Example

<!DOCTYPE html>
<html>
<body>
<!--   w  w  w.ja v  a 2s .c o  m-->
<p oncut="myFunction()">Cut me by pressing ctrl-x</p>

<script>
function myFunction() {
    console.log("cut!");
}
</script>

</body>
</html>

Click to view the demo