Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

onafterprint event

onafterprint event

Event Object Reference Event Object

Example

Execute JavaScript after the page is printed:

Try it »


Definition and Usage

The onafterprint event is triggered after the page is printed, or after the print dialog is closed.

Tip: The opposite event of the onafterprint event is onbeforeprint events.


Browser support

Events
onafterprint 63 Yes Yes Not supported Not supported

Syntax

In HTML:

<

element

onafterprint="

myScript

">

Try it

In JavaScript:

object

.onafterprint=function(){

myScript

};

Try it

In JavaScript, use the addEventListener() method:

object

.addEventListener("afterprint",

myScript

);

Try it

Note: Internet Explorer 8 and earlier IE versions do not support addEventListener() method.


Technical Details

Does it support bubbling: No
Is it cancelable: No
Event type: Event
Supported HTML tags:  

Event Object Reference Event Object