假设div1是要打印的内容id document.body.innerHTML=document.getElementById('div1').innerHTML; window.print();执行这段代码就可以打印