JSFiddle - React, Tailwind, and code Playground

by neilghosh

HTML

<canvas id="myCanvas" style="margin-left:auto; margin-right: auto;width:700px;height:100px;border:1px solid grey"></canvas>

JavaScript

var canvas = $("#myCanvas");

var pen = canvas[0].getContext("2d");

pen.strokeStyle = "#000000";
pen.lineWidth = "2";

pen.beginPath();
pen.moveTo(700, 100);
pen.lineTo(0,0);

pen.stroke();