반응형
목록javascript print (1)
내일을 위한 오늘
JS#1. Print a specific part of a webpage with javascript
1. Printing using window.onbeforeprint and window.onafterprint. var prtContent; // The content you want to print var initBody; // Original web page body content function startPrint (div_id) { prtContent = document.getElementById(div_id); window.onbeforeprint = beforePrint; window.onafterprint = afterPrint; window.print(); } function beforePrint(){ initBody = document.body.innerHTML; document.bod..
IT·컴퓨터/javascript
2022. 5. 31. 15:14
728x90
반응형