html2canvas - hidden text

by bangiev

HTML

<script src="https://html2canvas.hertzen.com/dist/html2canvas.min.js"></script>
<div id="inputHtml" style="width: 400px;">
  <h2 style="text-align: left">
    <span style="font-size: 24px;">What is Lorem Ipsum?</span>
  </h2>
  <p style="text-align: justify">
    <strong style="background-color: rgb(255, 255, 255); font-size: 14px;">
      Lorem Ipsum
    </strong>
    
    <!-- Removing the background-color style of this span element, makes the previous element's text visible. -->
    <span style="background-color: rgb(255, 255, 255);">
      is simply dummy text of the printing and typesetting industry. Lorem Ipsum
      has been the industry&#39;s standard dummy text ever since the 1500s, when
      an unknown printer took a galley of type and scrambled it to make a type
      specimen book.
    </span>
  </p>
</div>
<br>

JavaScript

var inputHtml = document.getElementById('inputHtml');

html2canvas(inputHtml)
	.then(canvas => {
    document.body.appendChild(canvas)
	});