JSFiddle - React, Tailwind, and code Playground

HTML

<html>
<body>
</body>
</html>

JavaScript

var c=document.createElement("CANVAS");
c.width=16;c.height=16;
var ct=c.getContext("2d");
ct.fillStyle='green';
ct.fillRect(0,0,16,16);
document.getElementsByTagName("body")[0].appendChild(c);
console.log(c.toDataURL());