Apply it:
<script> function printData() { var divToPrint=document.getElementById('myElement1'); var newWin=window.open('','Print-Window'); newWin.document.open(); newWin.document.write('<html><body onload="window.print()">'+divToPrint.innerHTML+'</body></html>'); newWin.document.close(); setTimeout(function(){newWin.close();},10); } </script>
Hope it will be helpful for you.
Question and answer is powered by AnsPress.io