<!DOCTYPE html>
<html>
<head>
<link type="text/css" rel="stylesheet" href="css/style.css">
<script>
function print_div(div){
var restorepage = document.body.innerHTML;
var printDiv = document.getElementById(div).innerHTML;
document.body.innerHTML = printDiv;
window.print();
document.body.innerHTML = restorepage;
}
</script>
</head>
<body>
<div id="container">
<div id="wrapper">
<div id="div1">
Print Div1
<h1>Personal Information</h1>
<div class="personal">
Name: GeePee</br>
Last name: Pabz</br>
E-mail: geepee@geepee.com
</div>
</div>
<button onClick="print_div('div1')">Print</button>
<div id="div2">
Print Div2</br></br>
This is an example to print a specific parts of a document.
</div>
<button onClick="print_div('div2')">Print</button>
<div id="div3">
Print Div3</br></br>
<img src="images/logo.png" width="490" height="105"></br></br>
www.sourcecodester.com
</div>
<button onClick="print_div('div3')">Print</button>
</div>
<button onClick="print_div('wrapper')" style="float:right;">Print Page</button>
</div>
</body>
</html>