Easy Tutorial
❮ Att Fieldset Name Att Global Style ❯

HTML5 onafterprint Event Attribute

HTML Event Attributes

Example

Execute JavaScript after the page setup and print dialog appear:


Browser Support

Event Attribute
onafterprint 63 12 6 13 50

Note: In IE browsers, the onafterprint attribute executes JavaScript before the print dialog instead of 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 often used together with the onbeforeprint attribute.


Differences Between HTML4.01 and HTML5

The onafterprint attribute is new in HTML5.


Syntax

Attribute Value

Value Description
script The script to be executed in onafterprint.

❮ Att Fieldset Name Att Global Style ❯