Javascript print page

You can use Javascript's window.print() function to print a webpage.

NOTE: The window.print() 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 can choose how you're going to print the page.

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

Click on the button in the above example to bring up the print options window in which you can choose how you're going to print the page.

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