JSFiddle - React, Tailwind, and code Playground
HTML
<canvas id="canvas"></canvas>
JavaScript
var c=document.getElementById("canvas");
var ctx=c.getContext("2d");
ctx.fillStyle = "red";
ctx.fillRect(0, 0, 300, 150);
ctx.fillStyle = "green";
ctx.fillRect(0, 0, 300, 150);
ctx.clearRect(20, 20, 150, 75);