Print a Web Page Using JavaScript - Javascript Views : 523
Tagged in : Javascript
0 0
Send mail
Print a Web Page Using JavaScript

To print your webpage using javascript use window.print(). It will print your webpage.

Here's the code:
<a href="javascript:window.print()">Print This Page</a>


Result:
Print This Page

You can set it to print off of an image:

<a href="javascript:window.print()">
<IMG SRC="print.gif" border="0"</a>


You can set it to trigger off a button:

<form>
<inout type="button" onClick="window.print()">
</form>


By Sanju, On - 2010-02-02



    Login to add Comments .