Javascript examples for DOM Event:onafterprint
The onafterprint event occurs when a page has started printing, or if the print dialogue box has been closed.
Bubbles | No |
---|---|
Cancelable | No |
Supported HTML tags: | ?<body> |
<!DOCTYPE html> <html> <body onafterprint="myFunction()"> <p>This example demonstrates how to assign an "onafterprint" event to a body element.</p> <h1>Try to print this document</h1> <script> function myFunction() {/* w ww . j ava 2s .co m*/ console.log("This document is now being printed"); } </script> </body> </html>