Javascript
  1. Javascript intro
  2. Javascript basics
  3. Javascript variables
  4. Javascript functions
  5. Javascript popup boxes
  6. Javascript conditions
  7. Javascript loops
  8. Javascript arrays
  9. Javascript objects
  10. Javascript strings
  11. Javascript events
  12. Javascript errors
  13. Javascript DOM
  14. Javascript elements
  15. Javascript new windows
  16. Javascript date & time
  17. Javascript cookies
  18. Javascript print
  19. Javascript redirect
  20. Javascript void
  21. Javascript summary

Javascript print

Javascript provides the ability to send the content of a webpage to be printed.

This tutorial focuses on:

The print() function

The print() function can be used to send the content of a webpage to be printed. This function will not actually print the page, but will achieve the same effect as going to the "File" menu and choosing the print option -- it will bring up the print options window in which you choose how to print a document.

Example:
<input type="button" onclick="window.print()" value="Print this page" />
Output:

Click on the button to bring up the print options window in which you can choose how to print a document.

© Copyright 2013-2014 Landofcode.com
Terms of use | Privacy policy | Copyright information