Execute a JavaScript when cutting some text of a <p> element - Javascript DOM Event

Javascript examples for DOM Event:oncut

Description

Execute a JavaScript when cutting some text of a <p> element

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p contenteditable="true" oncut="myFunction()">Try to cut this text</p>

<script>
function myFunction() {//  ww  w .  ja  v  a 2 s  .  com
    console.log("You cut text!");
}
</script>

</body>
</html>

Related Tutorials