Advertisement
Home Open Editor ❯

HTML onbeforeprint Attribute

Example

<body onbeforeprint="myFunction()">

Try this code ❯

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.
Home Open Editor ❯
Advertisement