Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- Oracle
- jQuery
- RabbitMQ
- install
- ubuntu
- i18n
- mariadb
- Eclipse
- php
- Postfix
- 문자열자르기
- 일괄변경
- TextBox
- 한글 깨짐
- Selectbox
- JavaScript
- yum
- TPL
- Python
- docker
- smarty
- 확장자
- replace
- SVN
- centos
- 부모창
- 천단위
- random
- MySQL
Archives
- Today
- Total
wilson's story
특정 div 프린트 하기 본문
반응형
function content_print(){ var initBody = document.body.innerHTML; window.onbeforeprint = function(){ document.body.innerHTML = document.getElementById('선택될 div id').innerHTML; } window.onafterprint = function(){ document.body.innerHTML = initBody; } window.print(); } ===============================================================================================내용 content_1내용 content_2================================================================================================ 선택될 div id 이부분에 div id 를 삽입하면 된다. print 버튼을 누르면 지정된 div 안의 내용이 프린트 된다.
반응형