Javascript DOM HTML Input Text handle copy event

Description

Javascript DOM HTML Input Text handle copy event

View in separate window

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

<p id="demo"></p>
<script>
function myFunction() {//ww  w .  java2  s .  co  m
  document.getElementById("demo").innerHTML = "You copied text!";
}
</script>

</body>
</html>



PreviousNext

Related