This article mainly shares with you the JS call browser printing implementation code, I hope it can help everyone.
function btnPrintClick(){ bdhtml=window.document.body.innerHTML; //先保存当前页面document.body.innerHTML=document.getElementById('task_form').innerHTML //获取需要打印的pwindow.print(); window.document.body.innerHTML=bdhtml; //重新设置回当前页面 }
Related recommendations:
JavaScript call browser print function example analysis_javascript skills
The above is the detailed content of js calls the browser to print the implementation code. For more information, please follow other related articles on the PHP Chinese website!