so i am trying to print a div with canvas element using a basic JavaScript onClick function. This div has canvas and other HTML elements.
any idea how i can print this div without .
PS: inner.HTML completely strips off the canvas element and gets the others. The output is supposed to show a signed signature within the canvas tag but rather displays only sign here?
function printDiv(divName){
var printContents = document.getElementById(divName).innerHTML;
var originalContents = document.body.innerHTML;
document.body.innerHTML = printContents;
window.print();
document.body.innerHTML = originalContents;
}
HTML
<div id="divName">
<span>Sign below</span>
<canvas></canvas>
</div>
<button id="print" name="print" onclick="printDiv('divName')"> PRINT </button>