beforeprint

L'événement beforeprint est déclenché lorsque le document associé est sur le point d'être imprimé ou qu'un "aperçu avant impression" est lancé.

Informations générales

Spécification

HTML5

Interface

Event

Propagation

Non

Annulable

Non

Cible

DefaultView (<window>)

Action par défaut

Aucune

Exemples

En utilisant window.addEventListener() :

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

Propriétés

Property Type Description
target Lecture seule EventTarget The event target (the topmost target in the DOM tree).
type Lecture seule DOMString The type of event.
bubbles Lecture seule Boolean Whether the event normally bubbles or not.
cancelable Lecture seule Boolean Whether the event is cancellable or not.

Evénements liés