Home >Web Front-end >JS Tutorial >js calls the browser to print the implementation code

js calls the browser to print the implementation code

小云云
小云云Original
2018-03-02 13:36:552251browse

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!

Statement:
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