JSFiddle - React, Tailwind, and code Playground

by ghayes

HTML

<div class="matting">
    <canvas id="canvas" width="200" height="300" />
</div>

CSS

.matting {
    background-color: black;
}

JavaScript

(function() {
    var b_canvas = $('#canvas');
    console.log(b_canvas[0]);
    var b_context = b_canvas[0].getContext("2d");
    b_context.fillStyle = "#f00";
    b_context.fillRect(50, 25, 150, 100);
    
})();