JSFiddle - React, Tailwind, and code Playground

HTML

<div id="rects"></div>

JavaScript

var R = Raphael('rects', 600, 500);

var i=0;
var y=10; 

for (i=0;i<=5;i++){
    
    var set = R.set();
    var x=10;
    for (n=0;n<=9;n++){
        var rectangle = R.rect(x,y,50,50);
        set.push(rectangle);
        x = x + 60;
    }
    set.hover(function(){
              this.animate({fill: '#000'}, 300);
          }, function(){
              this.animate({fill: '#FFF'}, 300);
          }
    );
    y = y + 60;
}