I'm encountering an issue with Html2canvas while trying to capture a screenshot of my page. Specifically, the date shown in the date-picker on the page is not appearing in the screenshot. Do you have any insights into why this might be happening and how I can troubleshoot it?
Below is the code snippet:
<div id='ownerDetails'>
<input type="date" class="the-inp date-input">
</div>
<button id="sig-submitBtn">save</button >
<button id='nextbt'>capture</button>
<img id='itemImg' src=''>
//////////////
$(".date-input").datepicker({ dateFormat: "yy-mm-dd"}).datepicker("setDate", new Date());
/////////
var element = $("#ownerDetails"); // global variable
var getCanvas; //global variable
$('#sig-submitBtn').on('click', function () {
html2canvas(element, {
onrendered: function (canvas) {
getCanvas = canvas;
}
});
});
$("#nextbt").on('click', function () {
var imgageData = getCanvas.toDataURL("image/png");
//Now browser starts downloading it instead of just showing it
document.getElementById("itemImg").src = imgageData;
});