JSFiddle - React, Tailwind, and code Playground

HTML

<table border="1" width="200">
    <tr id="myRow"><td>Hello</td><td>World</td></tr>
</table>

CSS

table {
margin: 50px;
}

#myRow { 
 background-color: red;   
}

JavaScript

$(function () {
    $("#myRow").on('click', function (e) {
       $(this).css('background-color', 'blue');
        e.stopPropagation();
    }); 

    $(document).on('click', function () {
    
       $("#myRow").css('background-color', 'red');
    });

});