kofzxaaa
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<canvas id="canvas"></canvas>
<script>
var can = document.getElementById("canvas");
var c = can.getContext('2d');
c.beginPath();
c.moveTo(50,50);
c.lineTo(50,100);
c.stroke();
c.closePath();
</script>
</body>
</html>记得把script标签放在body的最后就行了。