title: Screenshot of hidden div using html2canvas
body: <p>How to take screenshots of a hidden div?
  The code given below is not working for hidden div.</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;div id="mydiv" style="display:none;" &gt;  
   &lt;p&gt;Text&lt;/p&gt;
  &lt;/div&gt;
  
  &lt;div id="canvas" style="display:none;"&gt;
  &lt;p&gt;Canvas:&lt;/p&gt;
  &lt;/div&gt;
  
   &lt;div id="image"&gt;
  
    &lt;/div&gt;
  </code></pre>
  
  <p><strong>SCRIPT</strong></p>
  
  <pre><code>&lt;script&gt;
    var elem = $('#printDiv');
          html2canvas(elem, {
              onrendered: function (canvas) {
                  var data = canvas.toDataURL('image/png');
                  var image = new Image();
                  image.src = data;
                  document.getElementById('image').appendChild(image);
              }
          });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>It works when we set the style of the div "mydiv" as 'display:block'.</p>