Tags

, ,


Partial Page Print in HTM

To print a Partial Part of HTML page……..



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<script>
function printDiv()
{
  var printer = window.open('','','width=640,height=700');
	printer.document.open("text/html");
	printer.document.write(document.getElementById('printingstuff').innerHTML);
	printer.document.close();
	printer.window.close();
	printer.print();
	alert("Printing the \"printingstuff\" div...");
}
</script>
<title>Partial Page Printing Test Page</title>
</head>
<body>
<div id="printingstuff">
Hi Sajith, I m going to print now.....!
</div>
<div>
Hai Sajith u cant print me...!
</div>
<br /><span style="color:blue"  onclick="javascript:printDiv()">PRINT THIS PAGE</span>
</body>
</html>


Enjoy!

Advertisements