JSFiddle - React, Tailwind, and code Playground
HTML
<script src="//cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.js"></script>
<div class="previewWrap" id="preview">
<div class="previewText">Testing Content</div>
<img src="https://s3-eu-west-1.amazonaws.com/kienzle.geschaeft/yellow_MarkerA.png" alt=""/>
</div>
<div style="margin-top: 50px;" id="canvasImg"></div>
JavaScript
html2canvas($('#preview'), {
onrendered: function (canvas) {
var canvasImg = canvas.toDataURL("image/jpg");
$('#canvasImg').html('<img src="'+canvasImg+'" alt="">');
},
useCORS: true,
logging: true
});