JSFiddle - React, Tailwind, and code Playground

by Arthur Lutkevichus

HTML

<div id="test">
    asdasd
</div>

CSS

cavas {
    background: red
}

#test {
    background: green;
}

JavaScript

var canvas = document.createElement( "canvas" );
canvas.setAttribute( "width", 100 );
canvas.setAttribute( "height", 100 );
var ctx = canvas.getContext( "2d" );
ctx.beginPath();
ctx.moveTo( 0, 0 );
ctx.lineTo( 100, 0 );
ctx.stroke();
getElementById("test").innerHTML = ctx;