i have code that printing the selected div area after click on button print window open but problem is that when i type something into the textbox and then click on button then textbox values disppear from the page and also textbox value didn't appear in the print window?
<script>
function printDiv(divName) {
var printContents = document.getElementById(divName).innerHTML;
var originalContents = document.body.innerHTML;
document.body.innerHTML = printContents;
window.print();
document.body.innerHTML = originalContents;
}
</script>
<div id="printableArea">
<input type="text" >
</div>
<input type="button" onclick="printDiv('printableArea')" value="print a div!" />