How to Print Part of a Web Page [Code]

In: Tech Tips

16 Jun 2010

The following  JavaScript code enables you to print part of or a specific section of a web page. I found this very useful code at About.com, just follow the instructions in the link and you should be fine.

By using this code you can allow users to print only specific areas of a web page like ‘coupons’ or ‘business cards’ on an ecommerce site rather than printing the whole webpage. For instance, in the following page, only the dotted area is printed upon clicking ‘print this page’ at the bottom of the page.

print-part-of-a-webpageAlternatively, if you would like to print the entire webpage, you ca paste the following code between the <body> and </body> section of your webpage:

<a href=”javascript:print(document)”>print this page</a>

You might want to go through a useful tutorial on how to print part of a web page using  jQuery. You can do download the code snippet to print parts of a web page using jQuery here.

Blog Widget by LinkWithin

Comment Form

Follow Us on Twitter

About this blog

Hello, Welcome to Tech Inspiration. Here, we try to keep you up-to-date with Technology updates, Web 2.0, Software reviews, gadgets and more!; We hope you will love it and visit us more often. You can follow our feed here. If you have any questions, feel free to contact us. Hope you enjoy Tech Inspiration and take it easy.

-->

Subscribe to Our Newsletter and Get Updates via Email

Enter your email address: