Event Onafterprint
# onafterprint Event
[ Event Object](#)
## Example
Execute JavaScript after the page is printed:
[Try it Β»](#)
* * *
## Definition and Usage
The `onafterprint` event occurs after the page is printed, or after the print dialog has been closed.
**Tip:** The opposite event of `onafterprint` is the (#) event.
* * *
## Browser Support
| Event | | | | | |
| --- | --- | --- | --- | --- | --- |
| onafterprint | 63 | Yes | Yes | Not supported | Not supported |
* * *
## Syntax
In HTML:
(#)
In JavaScript:
_object_.onafterprint=function(){_myScript_};(#)
In JavaScript, using the addEventListener() method:
_object_.addEventListener("afterprint", _myScript_);(#)
**Note:** Internet Explorer 8 and earlier IE versions do not support the [addEventListener()](#) method.
* * *
Technical Details
| Bubbles: | No |
| --- |
| Cancelable: | No |
| Event type: | Event |
| Supported HTML tags: | |
* * Event Object](#)
YouTip