Window: beforeprint イベント
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2019年9月.
beforeprint
イベントは、関連する文書が印刷される直前や、印刷プレビューが開く直前に発生します。
バブリング | いいえ |
---|---|
キャンセル | 不可 |
インターフェイス | Event |
イベントハンドラープロパティ |
onbeforeprint
|
例
addEventListener()
の使用例:
js
window.addEventListener("beforeprint", (event) => {
console.log("Before print");
});
onbeforeprint
イベントハンドラープロパティの使用例:
js
window.onbeforeprint = (event) => {
console.log("Before print");
};
仕様書
Specification |
---|
HTML> # event-beforeprint> |
HTML> # handler-window-onbeforeprint> |
ブラウザーの互換性
Loading…
関連情報
- 関連イベント:
afterprint