HTML onafterprint Event Attribute

The HTML onafterprint event attribute is triggered when a page has started printing or if the print dialog box has been closed in the HTML document.

Syntax

Following is the syntax ?

Let us see an example of HTML onafterprint event Attribute?

Example






HTML onafterprint Event Attribute Demo

I'm a paragraph HTML element with some dummy text.

Now try to print this document.

Output

Now try to print the document by using ctrl + p and observe how onafterprint event attribute works.

Updated on: 2026-03-11T22:50:45+05:30

129 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements