HTMLonbeforeprint属性_


定義と使用法

このonbeforeprint属性は、ページが印刷されようとしているとき(印刷ダイアログボックスが表示される前)に起動します。

ヒント:このonbeforeprint属性は、多くの場合、属性と一緒に使用されonafterprintます。


に適用されます

このonbeforeprint属性はイベント属性の一部であり、次の要素で使用できます。

要素 イベント
<本体> onbeforeprint

ページが印刷されようとしているときにJavaScriptを実行します。

<body onbeforeprint="myFunction()">

ブラウザのサポート

Event Attribute
onbeforeprint 63 Yes Yes Not supported Not supported