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/beforeprint_event below:

Window: beforeprint event - Web APIs

Window: beforeprint event

Baseline Widely available

The beforeprint event is fired when the associated document is about to be printed or previewed for printing.

The afterprint and beforeprint 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("beforeprint", (event) => { })

onbeforeprint = (event) => { }
Event type

A generic Event.

Examples

Using addEventListener():

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

Using the onbeforeprint event handler property:

window.onbeforeprint = (event) => {
  console.log("Before 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