Javascript examples for DOM Event:onpaste
Execute a JavaScript when pasting some text in an <input> element:
<!DOCTYPE html> <html> <body> <input type="text" onpaste="myFunction()" value="Try to paste something in here" size="40"> <p id="demo"></p> <script> function myFunction() {// w w w . ja va 2s . c om document.getElementById("demo").innerHTML = "You pasted text!"; } </script> </body> </html>