<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="excanvas.js?v=3"></script>
</head>
<body>
<script>
function fa(){
var div = document.createElement("div");
div.id = "div";
div.innerHTML = "<div id='results'>R:<canvas id='canvas' width='200'
height='200'></canvas><canvas id='canvas2' width='200' height='200'></
canvas></div>";
$("#box")[0].appendChild(div);
var c = $("#canvas")[0];
alert(c);
if (!c.getContext){
c = G_vmlCanvasManager.initElement(c);
}
var ctx = c.getContext("2d");
ctx.strokeStyle = 'black';
ctx.lineWidth = 1;
ctx.beginPath();
ctx.moveTo(0,0);
ctx.lineTo(200,200);
ctx.closePath();
ctx.stroke();
}
</script>
<a href="#" onClick="fa()">GO</a>
<div id="box"></div>
</body>
</html>