Javascript examples for DOM Event:onpaste
Execute a JavaScript when pasting some text in a <p> element (Note that contenteditable is set to "true"):
<!DOCTYPE html> <html> <body> <p contenteditable="true" onpaste="myFunction()">Try to paste something inside this paragraph.</p> <script> function myFunction() {/*from w w w .j av a 2 s . co m*/ console.log("You pasted text!"); } </script> </body> </html>