執行 ❯
建立您
自己的
網站
×
更改方向
儲存程式碼
更改主題,深色/淺色
前往 Spaces
<!DOCTYPE html> <html> <body onafterprint="myFunction()"> <h1>Try to print this document</h1> <p><b>Tip:</b> Keyboard shortcuts, such as Ctrl+P sets the page to print.</p> <p><b>Note:</b> The onafterprint event is not supported in Safari and Opera.</p> <p><b>Note:</b> In IE, the onafterprint event occurs before the print dialogue box, instead of after.</p> <script> function myFunction() { alert("This document is now being printed"); } </script> </body> </html>