I see this answer, but how to proceed to print text from second, third div? This is what I want to:
<script type="text/javascript">
function PrintElem(elem)
{
    Popup($(elem).text());
}
function Popup(data) 
{
    var mywindow = window.open('', 'Coupon', 'height=300,width=710');
    mywindow.document.write('<html><head><title>Coupon</title>');
    /*optional stylesheet*/ mywindow.document.write('<link rel="stylesheet" href="cupon.css" type="text/css" />');
    mywindow.document.write('</head><body ><div class="coupon_logo"><img src="discount.jpg"></div><div class="coupon_conditions">');
             mywindow.document.write(data); // text from first div
    mywindow.document.write('</div>');
    mywindow.document.write('<div class="coupon_clinic_info">');
            //text from second div
    mywindow.document.write('</div>');
    mywindow.document.write('</body></html>');
    mywindow.print();
    mywindow.close();
    return true;
}
 
     
    