I am working on a project and I want to print div content.The code which I am using is fulfilling my requirements,but I am getting simple output without Css applied to it an
I combined and had this working perfectly:
function PrintElem(elem)
{
var mywindow = window.open('', 'PRINT', 'height=400,width=600');
mywindow.document.write('');
mywindow.document.write("")
mywindow.document.write('');
mywindow.document.write(document.getElementById('printit').innerHTML);
mywindow.document.write('');
mywindow.document.close(); // necessary for IE >= 10
mywindow.focus(); // necessary for IE >= 10*/
setTimeout(function () {
mywindow.print();
mywindow.close();
}, 1000)
return true;
}