JSFiddle - React, Tailwind, and code Playground

HTML

<a class="a">One<a>
<a class="a">Two<a>
<a class="a">Three<a>
<a class="a">Four<a>

JavaScript

function a(){
    for(var c=0; c<3; c++){
        //alert(c);
        var func = function(c){
            return function(){ // closes around the current value of "c"
                alert(c);
            };
        };
        $('.a:eq('+c+')').mouseover(func(c));       
    }
}
a();