How to print a portion of an HTML page?

前端 未结 4 1799
Happy的楠姐
Happy的楠姐 2021-01-13 06:35

I have an html page i want to print a portion of this html page, I know a javascript function to print a page,

onClick=\"javascript:window.print(); return fa         


        
4条回答
  •  广开言路
    2021-01-13 07:03

    You can apply a CSS style to hide everything but what you want printed for media="print" using Javascript.

    You can also load the page in another window or a [hidden]