HTML | onbeforeprint Event Attribute
The onbeforeprint attribute works when a page is about to be printed. The alert message display before the print dialogue box appears. The onbeforeprint attribute is used with the onafterprint attribute.
<element onbeforeprint = "script">
Attribute Value: This attribute contains single attribute value script and it works when document is about to print. This attribute is supported by <body> tag.
Supported Browsers: The browser supported by onbeforeprint attribute are listed below:
- Chrome 63
- Edge 12
- Internet Explorer 9
- Firefox 6
- Safari 13
- Opera 50