Home > Web Front-end > JS Tutorial > body text

js calls the browser to print the implementation code

小云云
Release: 2018-03-02 13:36:55
Original
2166 people have browsed it

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;
//重新设置回当前页面
    }
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!