Execute a JavaScript after a page is set to print, and the print dialogue box has appeared:
The onafterprint event attribute is only supported in Internet Explorer and Firefox.
Note: In IE, the onafterprint attribute occurs before the print dialogue box, instead of after.
The onafterprint attribute fires after the user has set the page to print, and the print dialogue box has appeared.
Tip: The onafterprint attribute is often used together with the onbeforeprint attribute.
The onafterprint attribute is new in HTML5.
| Value | Description |
|---|---|
| script | The script to be run on onafterprint |
HTML Event Attributes
Your message has been sent to W3Schools.