Javascript DOM oncut Event via HTML Tag oncut attribute

Introduction

This example demonstrates how to assign an "oncut" event to an input element.

View in separate window

<!DOCTYPE html>
<html>
<body>
<input type="text" oncut="myFunction()" value="Try to cut this text">

<p id="demo"></p>
<script>
function myFunction() {//from   w  w w. j  a v  a 2  s. c  om
  document.getElementById("demo").innerHTML = "You cut text!";
}
</script>

</body>
</html>
Bubbles: Yes
Cancelable: Yes
Event type: ClipboardEvent
Supported HTML tags: All HTML elements



PreviousNext

Related