Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the document</title> </head> <body> <canvas id="exampleCanvas" width="150" height="150" style="border:1px solid #cccccc;"> The HTML5 canvas tag is not supported by your browser. </canvas> <script> var c = document.getElementById("exampleCanvas"); var ctx = c.getContext("2d"); ctx.moveTo(0, 0); ctx.lineTo(150, 150); ctx.strokeStyle = '#86417d'; ctx.stroke(); </script> </body> </html>