I have a dynamic div class. The elements inside the div are dynamically populated through backend ajax web service requests. :-
Here is the code which I'm using to print a DIV content, and its working fine in IE as well,
function printPartOfPage(elementId) {
var printContent = document.getElementById(elementId);
var windowUrl = 'Job Receipt';
var uniqueName = new Date();
var windowName = 'Print' + uniqueName.getTime();
var printWindow = window.open(windowUrl, windowName, 'left=50000,top=50000,width=0,height=0');
printWindow.document.write(printContent.innerHTML);
printWindow.document.close();
printWindow.focus();
printWindow.print();
printWindow.close();
}
Please try this code