Latest web development tutorials

HTML5 onafterprint event properties

HTML Event Attributes HTML Event Attributes

Examples

Execute JavaScript after the page and print settings Print dialog box appears:

<body onafterprint="printmsg()">

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Currently, only Internet Explorer and Firefox browsers support onafterprint event attributes.

Note: In the IE browser, onafterprint properties in the Print dialog box before rather than after the implementation of Javascript.


Definition and Usage

onafterprint Properties Print and Print dialog box appears after the trigger in the user settings page.

Tip: onafterprint attributes usually associated with onbeforeprint used with property.


Differences between HTML 4.01 and HTML5

onafterprint property HTML5 is the new property.


grammar

<elementonafterprint=" script ">

Property Value

描述
script 在onafterprint中执行的脚本。


HTML Event Attributes HTML Event Attributes