A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/en-US/docs/Web/API/Window/afterprint_event below:

Window: afterprint event - Web APIs

Window: afterprint event

Baseline Widely available

The afterprint event is fired after the associated document has started printing or the print preview has been closed.

The beforeprint and afterprint events allow pages to change their content before printing starts (perhaps to remove a banner, for example) and then revert those changes after printing has completed. In general, you should prefer the use of a @media print CSS at-rule, but it may be necessary to use these events in some cases.

Syntax

Use the event name in methods like addEventListener(), or set an event handler property.

addEventListener("afterprint", (event) => { })

onafterprint = (event) => { }
Event type

A generic Event.

Examples

Using addEventListener():

window.addEventListener("afterprint", (event) => {
  console.log("After print");
});

Using the onafterprint event handler property:

window.onafterprint = (event) => {
  console.log("After print");
};
Specifications Browser compatibility See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3