Javascript examples for DOM Event:Element Event Attribute
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> <h1>Try to print this document</h1> <script> document.getElementsByTagName("BODY")[0].onafterprint = function() {myFunction()}; function myFunction() {/*w w w . j a v a 2 s .c o m*/ console.log("This document is now being printed"); } </script> </body> </html>