HTMLonbeforeprint属性_
定義と使用法
このonbeforeprint
属性は、ページが印刷されようとしているとき(印刷ダイアログボックスが表示される前)に起動します。
ヒント:このonbeforeprint
属性は、多くの場合、属性と一緒に使用されonafterprint
ます。
に適用されます
このonbeforeprint
属性はイベント属性の一部であり、次の要素で使用できます。
要素 | イベント |
---|---|
<本体> | onbeforeprint |
例
ページが印刷されようとしているときにJavaScriptを実行します。
<body onbeforeprint="myFunction()">
ブラウザのサポート
Event Attribute | |||||
---|---|---|---|---|---|
onbeforeprint | 63 | Yes | Yes | Not supported | Not supported |