Javascript examples for DOM Event:addEventListener
The onbeforeprint event occurs when a page is about to be printed.
Bubbles | No |
---|---|
Cancelable | No |
Supported HTML tags: | ?<body> |
<!DOCTYPE html> <html> <body> <h1>Try to print this document</h1> <script> window.addEventListener("beforeprint", myFunction); function myFunction() {//from w w w.j av a 2 s. c om console.log("You are about to print this document!"); } </script> </body> </html>