title: Making Screenshot Script TypeError: Cannot read properties of null (reading 'cloneNode')
body: <p>Whenever I press Download ScreenShot Button I get this error Uncaught (in promise) TypeError: Cannot read properties of null (reading 'cloneNode')
  at d (dom-to-image.min.js:2:1519)
  How do I fix this -
  HTML Code for understanding my problem - <a href="https://jsfiddle.net/m5gneoL7/" rel="nofollow noreferrer">https://jsfiddle.net/m5gneoL7/</a>
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code> &lt;button id="dload_img"&gt;Download&lt;/button&gt;
    &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"&gt;&lt;/script&gt;
    &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/dom-to-image/2.6.0/dom-to-image.min.js" integrity="sha512-01CJ9/g7e8cUmY0DFTMcUw/ikS799FHiOA0eyHsUWfOetgbx/t6oV4otQ5zXKQyIrQGTHSmRVPIgrgLcZi/WMA==" crossorigin="anonymous" referrerpolicy="no-referrer"&gt;&lt;/script&gt;
    &lt;script src="http://cdn.jsdelivr.net/g/filesaver.js"&gt;&lt;/script&gt;
    &lt;script&gt;
      $(document).ready(function() {
        $("#dload_img").click(function() {
          domtoimage.toBlob(document.getElementById('whole_page','')).then(function(blob){
            window.saveAs(blob, "output.png");
          });
        });
      });
    &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>