1 function Print() { 2 $.ligerDialog.confirm('确定要打印吗?', true, function (yes, value) { 3 if (yes) { 4 5 var oldhtml = document.body.innerHTML; 6 document.body.innerHTML = document.getElementById('Print_DIV').outerHTML; 7 window.print(); 8 window.close(); 9
.innerHTML
10 document.body.innerHTML = oldhtml; 11 }; 12 }); 13 }
只打印 此DIV内容
<div class="fuji" id="Print_DIV" >
<%--打印内容--%>
</div>