欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

js print打印網(wǎng)頁(yè)指定區(qū)域內(nèi)容的簡(jiǎn)單實(shí)例

 更新時(shí)間:2016年11月01日 09:06:14   投稿:jingxian  
下面小編就為大家?guī)?lái)一篇js print打印網(wǎng)頁(yè)指定區(qū)域內(nèi)容的簡(jiǎn)單實(shí)例。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧

實(shí)例如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>js print打印網(wǎng)頁(yè)指定區(qū)域內(nèi)容的簡(jiǎn)單實(shí)例</title>
</head>
<script>
function myPrint(obj){
  var newWindow=window.open("打印窗口","_blank");
  var docStr = obj.innerHTML;
  newWindow.document.write(docStr);
  newWindow.document.close();
  newWindow.print();
  newWindow.close();
}
</script>
<div id="print">
<hr />
  打印演示區(qū)域,點(diǎn)擊打印后會(huì)在新窗口加載這里的內(nèi)容!
<hr />
</div>
<button onclick="myPrint(document.getElementById('print'))">打 印</button>

</html>

以上就是小編為大家?guī)?lái)的js print打印網(wǎng)頁(yè)指定區(qū)域內(nèi)容的簡(jiǎn)單實(shí)例全部?jī)?nèi)容了,希望大家多多支持腳本之家~

相關(guān)文章

最新評(píng)論