亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

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

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

實(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ī)淼膉s print打印網(wǎng)頁(yè)指定區(qū)域內(nèi)容的簡(jiǎn)單實(shí)例全部?jī)?nèi)容了,希望大家多多支持腳本之家~

相關(guān)文章

最新評(píng)論