菜单切换
FACESOHO知行者
心灵
记录
远方
赞赏工具
源代码:
点击运行
保存
<!DOCTYPE html> <html> <meta charset="UTF-8"> <title>小鸟启蒙(facesoho.com)</title> <head> <script> function printmsg() { alert("你现在要打印该文档!"); } </script> </head> <body onbeforeprint="printmsg()"> <h1>打印文档</h1> <p><b>提示:</b> 快捷键, 如 Ctrl+P 设置打印页面。</p> <p><b>注意:</b> 目前只有 Internet Explorer 和 Firefox 浏览器支持 onafterprint 事件属性。</p> </body> </html>
运行结果