HTML5 onafterprint Event Attribute
Example
Execute JavaScript after the page is set up for printing and the print dialog appears:
Try it »
Browser support
| Event attribute | |||||
|---|---|---|---|---|---|
| onafterprint | 63 | 12 | 6 | 13 | 50 |
Note: In the IE browser, the onafterprint attribute executes JavaScript before the print dialog rather than after.
Definition and Usage
The onafterprint attribute is triggered after the user sets up the page for printing and the print dialog appears.
Tip: The onafterprint attribute is usually used with onbeforeprint property.
Differences between HTML 4.01 and HTML5
The onafterprint attribute is new in HTML5.
Syntax
<
element
onafterprint="
script
">
HTML Event Attributes