How to print only a selected HTML element?

前端 未结 8 2050
感动是毒
感动是毒 2020-11-29 05:11

I am trying to implement a print feature in HTML. I know I can print the whole page with window.print(), but how do I print only a specific page element? For ex

8条回答
  •  野性不改
    2020-11-29 05:32

    If you are familiar to jQuery, you can use jQuery Print Element plugin like this:

    $('SelectorToPrint').printElement();
    

提交回复
热议问题