你这里之前时对外面的盒子调用了 outerHTML ,是拿不到实际的值的(你直接把结果 console.log 出来就能看到了),你点击那个按钮打印看到的预览效果也应该是没有的,至少我这里是这样。 你应该使用 cloneNode ,去克隆你原来的节点。 Document 正位 外显斜 内显斜 外隐斜 内隐斜 点我打印 document.getElementById('dw').addEventListener('click', function () { $('#print-iframe').remove(); // 每次打印前移除先前生成的元素 // 开始打印 let iframe1 = document.createElement('IFRAME'); let doc1 = null; iframe1.setAttribute('id', 'print-iframe'); iframe1.setAttribute('style', 'position:absolute;width:0px;height:0px;left:-0px;top:-0px;visibility: auto;'); document.body.appendChild(iframe1); setTimeout(function () { doc1 = iframe1.contentWindow.document; doc1.body.appendChild(document.querySelector('#divKanZhengPanel-binli').cloneNode(true)); doc1.close(); iframe1.contentWindow.focus(); iframe1.contentWindow.print(); }); }); 打印效果: 