js打印页面div里面的东东

<script type="text/javascript">

function doPrint() {
var newWin = window.open(‘about:blank‘,‘‘,‘‘);
var titleHTML = document.getElementById("doctitle").innerHTML;
newWin.document.write(titleHTML);
newWin.document.location.reload();
newWin.print();
newWin.close();
}

 </script>
       <div id="doctitle">
            <table width="100%" border="0" .....
       </div>
<input id="Button1" onclick="doPrint()" type="button" value="打印test" />

js打印页面div里面的东东,布布扣,bubuko.com

js打印页面div里面的东东

上一篇:『HTMl5』学习日志


下一篇:在Raspberry Pi上安装XBMC