Opens the print dialog to print the current document.
If the document is still loading when this function is called, then the document will finish loading before opening the print dialog.
This method will block while the print dialog is open.
Opens the print dialog to print the current document.
If the document is still loading when this function is called, then the document will finish loading before opening the print dialog.
This method will block while the print dialog is open.
js
print()
None.
None (undefined
).
Specification |
---|
HTML Standard # printing |
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
print |
1Starting with Chrome 46, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals . |
12 | 1 | 5 | 6Starting with Opera 33, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals . |
1.1 | 4.4Starting with Chrome 46, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals . |
18Starting with Chrome 46, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals . |
114 | 10.1Starting with Opera 33, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals . |
1 | 1.0Starting with Samsung Internet 5.0, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals . |
beforeprint
eventafterprint
event
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Window/print