Print Content using Javascript

You can print HTML page or your browser contents using window.print() javascript function.

Definition and Usage

The print() method prints the contents of the current window.

The print() method opens the Print Dialog Box, which lets the user to select preferred printing options.




<title>Print Demo</title>
<p>Click the button to print the current page.</p>
<button onclick="javascript:window.print()">Print this page</button>

Live Demo

You can check Live Demo Here.


One comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s