JSFiddle - React, Tailwind, and code Playground

by hescano

HTML

<div class="PlaceViewIcon">
</div>
<br />
<div class="PlaceViewIcon">
</div>
<br />
<div class="PlaceViewIcon">
</div>
<br />
<div class="PlaceViewIcon">
</div>

CSS

.PlaceViewIcon
{
    background-color: red;
    width: 100px;
    height: 10px;
}

.red
{
    background-color: red;
}

.green
{
    background-color: green;
}

JavaScript

$(".PlaceViewIcon").each(function(){
    $(this).mouseover(function(){
        $(this).attr("style", "background:green");
    }).mouseout(function(){
      $(this).attr("style", "background:red");
    });
});