<body>
<canvas id="mycanvas" width="500" height="300">
你的浏览器不支持canvas元素
</canvas>
<script type="text/javascript">
var canvas=document.getElementById('mycanvas');
var h=canvas.getContext('2d');
h.moveTo(0,0);
h.lineTo(200,200);
h.stroke();
</script>
</body>