function PrintElem(elem) { Popup($(elem).html()); } function Popup(data) { var mywindow = window.open('', 'my div', 'height=400,width=600'); mywindow.document.write('my div'); /*optional stylesheet*/ //mywindow.document.write(''); mywindow.document.write(''); mywindow.document.write(data); mywindow.document.write(''); mywindow.document.close(); // necessary for IE >= 10 mywindow.focus(); // necessary for IE >= 10 mywindow.print(); mywindow.close(); return true; }