952 0 0 0
Last Updated : 2025-04-28 21:42:30
This snippet will allow you to print the content of specific div directly from your application
to print the content of specific div just use this function
function printDiv() {
let divToPrint=document.getElementById('DivIdToPrint'); // put you div id here
let 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);
}