Answers for "how to draw a triangle using javascript"

1

how to draw a triangle using javascript

<!doctype html>
<html>
<head>
<body>
<canvas></canvas>
<script>
var canvas=document.querySelector('canvas');
var context=canvas.getContext(2d);
context.beginPath();
    context.moveTo(75,75);
    context.lineTo(10,75);
    context.lineTo(10,25);
    context.fill();
    </script>
    </body>
    </head>
    </html>
Posted by: Guest on May-26-2020

Code answers related to "how to draw a triangle using javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language