console
var c=document.getElementById("my");
ctt=c.getContext("2d");
ctt.beginPath();
ctt.fillStyle='red';
ctt.fillRect(10,20,100,75);
ctt.clearRect(50,30,50,45);
ctt.beginPath();
ctt.lineWidth=4;
ctt.strokeStyle='red';
ctt.strokeRect(8,108,54,54);
ctt.fillStyle='yellow';
ctt.fillRect(10,110,50,50);
ctt.beginPath();
ctt.arc(170,55,30,0,0.5*Math.PI);
ctt.closePath();
ctt.stroke();
ctt.beginPath();
ctt.arc(280,55,50,0.5*Math.PI,0,true);
ctt.closePath();
ctt.fillStyle='purple'
ctt.fill();
ctt.beginPath();
ctt.lineWidth=4;
ctt.moveTo(180,120);
ctt.lineTo(240,200);
ctt.moveTo(240,200);
ctt.lineTo(250,320);
ctt.stroke();
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" charset="utf-8">
<title>我</title>
</head>
<body>
<canvas id="my" width="500px" height="450px" style="border:1px solid yellow;">
Your browser does not support the canvas element.
</canvas>
<script type="text/javascript">
</script>
</body>
</html>