The afterprint
event is fired after the associated document has started printing or the print preview has been closed.
Bubbles | No |
---|---|
Cancelable | No |
Interface | Event |
Event handler property | onafterprint |
Examples
Using addEventListener()
:
window.addEventListener('afterprint', (event) => { console.log('After print'); });
Using the onafterprint
event handler property:
window.onafterprint = (event) => { console.log('After print'); };
Specifications
Specification | Status |
---|---|
HTML Living Standard | Living Standard |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
afterprint event | Chrome Full support 63 | Edge Full support 12 | Firefox Full support 6 | IE Full support Yes | Opera Full support 50 | Safari Full support 13 | WebView Android Full support 63 | Chrome Android Full support 63 | Firefox Android ? | Opera Android Full support 46 | Safari iOS Full support 13 | Samsung Internet Android Full support 8.0 |
Legend
- Full support
- Full support
- Compatibility unknown
- Compatibility unknown
See also
- Related events:
beforeprint