JSFiddle - React, Tailwind, and code Playground

by intrinsica

HTML

<canvas id="name-of-existing-or-new-HTML-item" width="300px" height="300px"></canvas>

CSS

/*#bb {background-color:#f70;}*/

JavaScript

var definedNamefromHTML = document.getElementById("name-of-existing-or-new-HTML-item");
var context = definedNamefromHTML.getContext("2d");

context.fillStyle = "#f70";
context.fillRect(0,0,definedNamefromHTML.width,definedNamefromHTML.height);