Print DIV content by JQuery

前端 未结 6 855
无人共我
无人共我 2021-02-06 03:26

suppose i have many div\'s in my page but i want to print the content of specific div using jquery. i found there is a plugin for that.

jQuery Print Element

usin

6条回答
  •  花落未央
    2021-02-06 04:05

    You can follow these steps :

    1. wrap the div you want to print into another div.
    2. set the wrapper div display status to none in css.
    3. keep the div you want to print display status as block, anyway it will be hidden as its parent is hidden.
    4. simply call $('SelectorToPrint').printElement();

提交回复
热议问题