Print text from few div
<p>I see this <a href="http://stackoverflow.com/a/2255438/1511551">answer</a>, but how to proceed to print text from second, third div?
This is what I want to:</p>

<pre><code>&lt;script type="text/javascript"&gt;
function PrintElem(elem)
{
    Popup($(elem).text());
}
function Popup(data) 
{
    var mywindow = window.open('', 'Coupon', 'height=300,width=710');
    mywindow.document.write('&lt;html&gt;&lt;head&gt;&lt;title&gt;Coupon&lt;/title&gt;');
    /*optional stylesheet*/ mywindow.document.write('&lt;link rel="stylesheet" href="cupon.css" type="text/css" /&gt;');
    mywindow.document.write('&lt;/head&gt;&lt;body &gt;&lt;div class="coupon_logo"&gt;&lt;img src="discount.jpg"&gt;&lt;/div&gt;&lt;div class="coupon_conditions"&gt;');
             mywindow.document.write(data); // text from first div
    mywindow.document.write('&lt;/div&gt;');
    mywindow.document.write('&lt;div class="coupon_clinic_info"&gt;');
            //text from second div
    mywindow.document.write('&lt;/div&gt;');
    mywindow.document.write('&lt;/body&gt;&lt;/html&gt;');
    mywindow.print();
    mywindow.close();
    return true;
}
</code></pre>

<p></p>
