HTML5

다음 코드를 실행하여 HTML5 Canvas를 사용하여 선을 그리는 방법을 배울 수 있습니다.
예시
<!DOCTYPE html>
<html>
<head>
<title>HTML5 Canvas Tag</title>
</head>
<body>
<canvas id="newCanvas" width="400" height="300" style="border:1px
solid #000000;"></canvas>
<script>
var c = document.getElementById('newCanvas');
var ctx = c.getContext('2d');
// Drawing lines
ctx.beginPath();
ctx.moveTo(30, 30);
ctx.lineTo(180, 100);
ctx.moveTo(30, 10);
ctx.lineTo(260, 100);
ctx.stroke();
</script>
</body>
</html> 출력
