function PrintElem(elem){ var mywindow = window.open('', 'PRINT', 'height=400,width=600'); mywindow.document.write('<html><head><title>' + document.title + '</title>'); mywindow.document.write('</head><body >'); mywindow.document.write('<h1>' + document.title + '</h1>'); mywindow.document.write(document.getElementById(elem).innerHTML); mywindow.document.write('</body></html>'); mywindow.document.close(); // necessary for IE >= 10 mywindow.focus(); // necessary for IE >= 10*/ mywindow.print(); mywindow.close(); return true;}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)