This example assigns an "onbeforeprint" event to the body element.
Tip: The keyboard shortcut Ctrl+P prints a page.