title: How to show JS-generated img on print
body: <p>I have a following code:</p>
  
  <pre><code>jQuery('#print').on("click", function(){
      var mywindow = window.open('', 'my div', 'height=400,width=600');
  
      mywindow.document.write('&lt;html&gt;&lt;head&gt;&lt;title&gt;Title&lt;/title&gt;');
      mywindow.document.write('&lt;/head&gt;&lt;body &gt;');
      mywindow.document.write('&lt;img src="https://www.google.pl/images/srpr/logo11w.png" alt="logo"/&gt;');
      mywindow.document.write('&lt;/body&gt;&lt;/html&gt;');
  
      mywindow.print();
      mywindow.close();
  
      return true;
  });
  </code></pre>
  
  <p>What it does, is when somebody click on #print button, small window containing google logo appears with already opened printing popup. Unfortunatelly, when I print this on paper or to PDF, the image doesn't appear - showing it's alt attribute instead.</p>
  
  <p>How can I fix that?</p>