欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  web前端

window.print打印指定div实例代码_javascript技巧

程序员文章站 2022-04-12 11:04:06
...
首先我们可以把要打印的内容放在div中,然后用下面的代码进行打印。

复制代码 代码如下:




div print


//HTML Page
//Other content you wouldn't like to print

The Div content which you want to print


//Other content you wouldn't like to print
//Other content you wouldn't like to print