HTML onbeforeprint Attribute
Example
<body onbeforeprint="myFunction()">
Meaning
The onbeforeprint attribute is called before a print event. Found only on the body element.
Standard Syntax
<element onbeforeprint="script">
Applies to:
The onbeforeprint attribute can be used on the following element:
| Element | Attribute |
|---|---|
| <body> | onbeforeprint |
Advertisement
Attribute Values
| Value | Description |
|---|---|
| script | Specifies the script to be run on onbeforeprint. |