JSFiddle - React, Tailwind, and code Playground

HTML

<table>
    <tr style="background-color: blue;"><td>AAA</td></tr>
    <tr><td>BBB</td></tr>
    <tr><td>CCC</td></tr>
</table>

CSS

.highlightrow { background-color: yellow; }

JavaScript

$(document).ready(function () {
    $('tr').mouseover(function () {
        $(this).data("prev_color", $(this).css("background-color"));
        $(this).toggleClass('highlightrow').css("background-color", "yellow");
    }).mouseout(function() {
        $(this).removeClass('highlightrow').css("background-color", $(this).data("prev_color"));
    });
});