HTML5 onbeforeprint event properties
Examples
In the Page Setup print, but the print dialog box appears before the implementation of JavaScript:
<body onbeforeprint="printmsg()">
try it"
Browser Support
Currently, only Internet Explorer and Firefox browsers support onbeforeprint event attributes.
Definition and Usage
onbeforeprint attribute in the user settings page prints, but before the Print dialog box appears trigger.
Tip: onbeforeprint attributes usually associated with onafterprint used with property.
Differences between HTML 4.01 and HTML5
onbeforeprint property HTML5 is the new property.
grammar
<elementonbeforeprint=" script ">
Property Value
值 | 描述 |
---|---|
script | onafterprint中执行的脚本。 |
HTML Event Attributes