Execute a JavaScript when copying an image: - Javascript DOM Event

Javascript examples for DOM Event:oncopy

Description

Execute a JavaScript when copying an image:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<img src="http://java2s.com/resources/a.png" oncopy="myFunction()" width="100" height="132">

<script>
function myFunction() {/*w w w . j  av a2  s .co m*/
    console.log("You copied image!");
}
</script>

</body>
</html>

Related Tutorials