<html>
<head>
<!--[if IE]><script type="text/javascript" src="excanvas.js"></script><![endif]-->
<script type="text/javascript">
window.onload = function() {
draw();
};
function draw() {
var canvas = document.getElementById('canvassample');
if ( ! canvas || ! canvas.getContext ) {
return false;
}
var ctx = canvas.getContext('2d');
ctx.beginPath();
ctx.fillStyle = 'red';
ctx.font = 'bold 20px sans-serif';
ctx.textBaseline = 'top';
ctx.fillText ('Hello Canvas!', 0, 0);
ctx.strokeStyle = 'red';
ctx.lineWidth = 4;
ctx.moveTo(20, 60);
ctx.lineTo(1200, 60);
ctx.closePath();
ctx.stroke();
}
</script>
</head>
<body>
<div width ="500">
<canvas id="canvassample"></canvas>
</div>
</body>
</html>