title: JavaScript Screen Capture separate DOM elements
body: <p>I have this code below that contains 3 separated divs i'm currently able to capture and download the yellow div in a png image. But what i'm trying to accomplish is to capture the yellow and black into a single image and download it.</p>
  
  <p>Is this function possible with the library i'm using or is there a better way to do it? Any help / suggestion would be greatly appreciated thanks.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function sendData() {
    html2canvas(document.getElementById('capture')).then(function(canvas) {
      $('#test').attr('href', canvas.toDataURL('image/png'));
      $('#test').attr('download', 'Test.png');
      $('#test')[0].click();
    });
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;html&gt;
  
  &lt;head&gt;
    &lt;meta charset="utf-8" /&gt;
    &lt;link rel="shortcut icon" href="//#" /&gt;
    &lt;script type="text/javascript" src="https://html2canvas.hertzen.com/dist/html2canvas.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="https://html2canvas.hertzen.com/dist/html2canvas.min.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;div id="capture" style="padding: 10px; background: #f5da55"&gt;
      &lt;h4 style="color: #000; "&gt;Helloo world!&lt;/h4&gt;
    &lt;/div&gt;
  
    &lt;div style="padding: 10px; background: pink"&gt;
      &lt;h4 style="color: #000; "&gt;Helloo world!&lt;/h4&gt;
    &lt;/div&gt;
  
    &lt;div style="padding: 10px; background: black"&gt;
      &lt;h4 style="color: white; "&gt;Helloo world!&lt;/h4&gt;
    &lt;/div&gt;
    &lt;div id="match-button" onclick="sendData();"&gt;capture&lt;/div&gt;
    &lt;a id="test" href="#"&gt;&lt;/a&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>