Print Popup Window JavaScript

This JavaScript / jQuery sends parts of the content into a popup for preview and then opens a print dialogue. Print popup window JavaScript and jQuery.

<div class="contentSection">
	<div class="contentToPrint">
		<!-- content to be printed here -->

<div class="contentSection">
	<a href="#" id="printOut">Print This</a>

<div class="contentSection termsToPrint">
	<h4>Terms & conditions</h4>
	<p>Management reserves the right to withdraw, amend or suspend this print job in the event of any unforeseen circumstances outside its reasonable control, with no liability to any third party.</p>

<script type="text/javascript" src=""></script>

<script type="text/javascript">
			var w =;
			var printOne = $('.contentToPrint').html();
			var printTwo = $('.termsToPrint').html();
			w.document.write('<html><head><title>Copy Printed</title></head><body><h1>Copy Printed</h1><hr />' + printOne + '<hr />' + printTwo) + '</body></html>';
			return false;


Web Development - XHTML CSS JavaScript jQuery.

Google Reddit Twitter Facebook Pinterest StumbleUpon