打印当前页面

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <script>
  5. function printPage() {
  6. window.print();
  7. }
  8. </script>
  9. </head>
  10. <body>
  11.  
  12. <input type="button" value="打印此页" onclick="printPage()" />
  13.  
  14. </body>
  15. </html>