WEB

한페이지에서 여러 영역 인쇄하기

by 꽃지닷컴 posted Apr 13, 2017
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄

<script language="javascript">
var win = null;

function AreaPrintAll(printThis){
  win = window.open();
  self.focus();
  win.document.open();
  win.document.write ('<'+'html'+'>');

  win.document.write ('<'+'head'+'>');
  win.document.write ('<'+'/'+'head'+'>');
  win.document.write ('<'+'body'+'>');
  win.document.write (printThis);
  win.document.write ('<'+'/'+'body'+'><'+'/'+'html'+'>');
  win.document.close();
  win.print();
  win.close();
}
</script>

 

<html>

<head>

</head>

<body>

 

<div id="box1">첫번째 영역</div>

 

<div id="box2">두번째 영역</div>

 

<div id="box3">세번째 영역</div>

 

<a href="javascript:AreaPrintAll(document.getElementById('box1').innerHTML);">첫번째 영역을 출력 합시다.</a><br />

<a href="javascript:AreaPrintAll(document.getElementById('box2').innerHTML);">두번째 영역을 출력 합시다.</a><br />

<a href="javascript:AreaPrintAll(document.getElementById('box3').innerHTML);">세번째 영역을 출력 합시다.</a>

[출처] 지정 영역만 프린트(PRINT) 하기....한페이지에 여러 영역이 있을 경우 (불사신조드의 웹디자인/웹프로그램) |작성자 초천재

Who's 꽃지닷컴

profile

Respect yourself and others will respect you

- 창의적 사고를 하자!

- 소규모 웹사이트 제작 및 수정 (24시간 항시대기)


Articles

1 2 3 4 5 6 7 8 9 10