This example uses the addEventListener() method to attach an "afterprint" event to the window object.

Try to print this document

Tip: Keyboard shortcuts, such as Ctrl+P sets the page to print.

Note: The afterprint event is only supported in Internet Explorer and Firefox.

Note: In IE, the afterprint event occurs before the print dialogue box, instead of after.