I'm loading a html into a DIV. The users are allowed to do some changes here.
My question is how do I use drawImage()
to duplicate it into another DIV?
I tried the below but it gives a blank canvas?
HTML:
<canvas id="myCanvas" width="250" height="300" style="border:1px solid #d3d3d3;">Does not support HTML5 canvas.</canvas>
JS:
$("#winNumbers").load("hourly/winningNums.html");
var img = $("#winNumbers");
$("#myCanvas").getContext("2d").drawImage(img, 0, 0, 100, 50);