let canvas = document.getElementById("mycanvas"); let img = canvas.toDataURL("image/png"); document.write('<img src="'+img+'"/>');