Prev Demo
Stroke
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Stroke</title> </head> <body> <canvas id="mycanvas" height="300" width="600"></canvas> <script> var canvas = document.getElementById("mycanvas"); var context = canvas.getContext("2d"); context.beginPath(); context.moveTo(10, 10); context.lineTo(10, 150); context.lineTo(110, 50); context.lineTo(10, 10); context.stroke(); context.closePath(); </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output