Friday, December 14, 2012

Javascript - Page printing

Javascript - Page printing

Many times you want to print the page or print any forms or informations. So this function is very helpful for all the web- programmers.

The JavaScript print function window.print() will print the current web page when executed. You can call this function directly using onclick event as follows:



Example:

<head>
<script type="text/javascript"> <!-- //--> </script> </head> <body> <form> <input type="button" value="Print" onclick="window.print()" /> </form> </body>

No comments:

Post a Comment