0

I want to print selected Div(s) of my web page using jqpring.

i.e.

<div id="divToPrint1">
Content/section to be printed.
</div>

<div id="divDontPrint1">
Content/section which will not be printed.
</div>

<div id="divToPrint2">
Content/section to be printed.
</div>

<div id="divDontPrint2">
Content/section which will not be printed.
</div>

Objective: out of all the Divs here, i want to print divToPrint1 & divToPrint2 only in one document.

Any help would be highly appreciated!

Thanks.

4

1 に答える 1

1

のようにしてみてください

$('#my_div').html($('#divToPrint1').html());
$('#my_div').append($('#divToPrint2').html());

次に、 my_div のように出力します

$('#my_div').print();
于 2013-06-06T10:34:44.733 に答える