執行 ❯
建立您
自己的
網站
×
更改方向
儲存程式碼
更改主題,深色/淺色
前往Spaces
<!DOCTYPE html> <html> <body onbeforeprint="myFunction()"> <h1>HTML DOM Events</h1> <h2>The beforeprint Event</h2> <h3>Print this document!</h3> <p><b>Tip</b>: The keyboard shortcut Ctrl+P prints a page.</p> <script> function myFunction() { alert("You are about to print this document!"); } </script> </body> </html>