JSFiddle - React, Tailwind, and code Playground

by Amar Nyayapati

HTML

<script>
function draw() {  
      var canvas = document.getElementById("canvas");  
      if (canvas.getContext) {  
        var ctx = canvas.getContext("2d");  
  
        ctx.fillStyle = "red";  
        ctx.fillRect (10, 10, 55, 50);  
  
        ctx.fillStyle = "lightgreen";  
        ctx.fillRect (30, 30, 55, 50);  
      }  
    }  
  </script>  

 <body onload="draw();">  
   <canvas id="canvas" width="150" height="150"></canvas>