Javascript examples for DOM Event:Element Event Attribute
The oncopy event occurs when copying the content of an element.
Bubbles | Yes |
---|---|
Cancelable | Yes |
Supported HTML tags: | All HTML elements |
<!DOCTYPE html> <html> <body> <input type="text" id="myInput" value="Try to copy this text"> <script> document.getElementById("myInput").oncopy = function() {myFunction()}; function myFunction() {/* www . ja v a 2s .c o m*/ console.log("You copied text!"); } </script> </body> </html>