YouTip LogoYouTip

Event Onbeforeprint

# onbeforeprint Event [![Image 3: Event Object Reference](#) Event Object](#) ## Example Execute JavaScript when the page is about to print: [Try it Β»](#) * * * ## Definition and Usage The onbeforeprint event occurs when a page is about to be printed (before the print dialog appears). **Note:** The opposite event of onbeforeprint is (#). * * * ## Browser Support | Event | | | | | | | --- | --- | --- | --- | --- | --- | | onbeforeprint | Not supported | Yes | Yes | Not supported | Not supported | * * * ## Syntax In HTML: (#) In JavaScript: _object_.onbeforeprint=function(){_myScript_};(#) In JavaScript, using the addEventListener() method: _object_.addEventListener("beforeprint", _myScript_);(#) **Note:** Internet Explorer 8 and earlier IE versions do not support the [addEventListener()](#) method. * * * Technical Details | Bubbles: | No | | --- | | Can be canceled: | No | | Event type: | Event | | Supported HTML tags: | | * * Event Object](#)
← Python Quiz FunctionC Examples Joseph Life Dead Ga β†’