자바스크립트

div태그로 지정된 영역만 출력

작성자 정보

  • 관리자 작성
  • 작성일

컨텐츠 정보

본문

<html>
<head>
    <title>http://www.blueb.co.kr</title>
   
<script type="text/javascript">
  var win=null;
  function printIt(printThis)  {
    win = window.open();
    self.focus();
    win.document.open();
    win.document.write('<'+'html'+'><'+'head'+'><'+'style'+'>');
    win.document.write('body, td { font-family: Verdana; font-size: 10pt;}');
    win.document.write('<'+'/'+'style'+'><'+'/'+'head'+'><'+'body'+'>');
    win.document.write(printThis);
    win.document.write('<'+'/'+'body'+'><'+'/'+'html'+'>');
    win.document.close();
    win.print();
    win.close();
  }
</script>
</head>
<body>

<a href="javascript:printIt(document.getElementById('printme').innerHTML)">Print</a><p>

<div id="printme">
이 부분만 출력</div>


</body>
</html>

관련자료

댓글 0
등록된 댓글이 없습니다.

최근글


새댓글


  • 댓글이 없습니다.