Write a JavaScript program to display line on canvas.
<html>
<head>
<title>Display line on canvas</title>
</head>
<body>
<canvas id="myCanvas" width="300" height="150" style="border:1px solid #d3d3d3; background-color:beige;">
</canvas>
<br>
<br>
<input type="button" Value="Draw Line" Onclick="DrawLine()">
<script>
function DrawLine()
{
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.beginPath();
ctx.moveTo(80, 20);
ctx.lineTo(120, 100);
ctx.stroke();
}
</script>
</body>
</html>
